summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author smf- <smf-@users.noreply.github.com>2016-10-17 16:03:29 +0100
committer smf- <smf-@users.noreply.github.com>2016-10-17 16:04:02 +0100
commit36944269bd6fe1fb47822a2112c524b13c4b27f2 (patch)
treec1b29a760bb9a1e222a9390fbc34fe09d407ae91 /src
parent8676fc0d8dd0c3ccf2925075d86338da099ce148 (diff)
DAC WIP, started documenting the DACs in use. [smf]
ataxx: Fixed missing sound channel caused by one dac not being hooked up and one dac being hooked up to two addresses. bestbest: Fixed high pitch screech caused by incorrect addressing (two dacs weren't hooked up and two were hooked up to two addresses). cchasm: Fixed static noise generation caused by feeding the same bit to both dacs. cheekyms: Slightly improved sound by implementing sound triggers as 8 x 1 bit dacs instead of 1 x 8 bit dac. galeb: Fixed sound by implementing it according to http://www.deltasoft.com.hr/retro/galebemu.htm & implemented enough of LOAD/SAVE to stop it hanging. hard drivin: (all games in driver) Improved 12 bit controls, although centre still goes out of sync. mea8000: Converted to a sound device. megaphx: Fixed noisy samples due to wrong format. microvsn: Fixed sound pitch caused by incorrect usage of write_signed8(). seicross: Changed to a 4 bit dac as samples are packed nibble. spaceg: Preliminary sound using space invaders samples. suna8: Changed to a 4 bit dac as samples are packed nibble. vcombat: Fixed static during machine gun fire due to incorrect dc offset removal. vectrex: Fixed noisy samples due to wrong format. wheelfir: Fixed sound, eeprom & analogue steering wheel and brake pedal.
Diffstat (limited to 'src')
-rw-r--r--src/devices/bus/a2bus/a2dx1.cpp37
-rw-r--r--src/devices/bus/a2bus/a2dx1.h7
-rw-r--r--src/devices/bus/a2bus/a2sam.cpp24
-rw-r--r--src/devices/bus/a2bus/a2sam.h3
-rw-r--r--src/devices/bus/centronics/covox.cpp35
-rw-r--r--src/devices/bus/centronics/covox.h6
-rw-r--r--src/devices/bus/centronics/digiblst.cpp12
-rw-r--r--src/devices/bus/centronics/digiblst.h2
-rw-r--r--src/devices/bus/centronics/epson_lx810l.cpp19
-rw-r--r--src/devices/bus/centronics/epson_lx810l.h2
-rw-r--r--src/devices/bus/coco/coco_orch90.cpp25
-rw-r--r--src/devices/bus/coco/coco_orch90.h4
-rw-r--r--src/devices/bus/cpc/amdrum.cpp12
-rw-r--r--src/devices/bus/cpc/amdrum.h2
-rw-r--r--src/devices/bus/cpc/magicsound.cpp14
-rw-r--r--src/devices/bus/cpc/magicsound.h2
-rw-r--r--src/devices/bus/isa/dectalk.cpp8
-rw-r--r--src/devices/bus/isa/dectalk.h2
-rw-r--r--src/devices/bus/isa/p1_sound.cpp12
-rw-r--r--src/devices/bus/isa/p1_sound.h2
-rw-r--r--src/devices/bus/isa/sb16.cpp50
-rw-r--r--src/devices/bus/isa/sb16.h4
-rw-r--r--src/devices/bus/isa/sblaster.cpp94
-rw-r--r--src/devices/bus/isa/sblaster.h4
-rw-r--r--src/devices/bus/isa/stereo_fx.cpp17
-rw-r--r--src/devices/bus/isa/stereo_fx.h3
-rw-r--r--src/devices/bus/lpci/southbridge.h1
-rw-r--r--src/devices/bus/msx_cart/konami.cpp10
-rw-r--r--src/devices/bus/msx_cart/konami.h2
-rw-r--r--src/devices/bus/msx_cart/majutsushi.cpp10
-rw-r--r--src/devices/bus/msx_cart/majutsushi.h2
-rw-r--r--src/devices/bus/pet/2joysnd.cpp14
-rw-r--r--src/devices/bus/pet/2joysnd.h2
-rw-r--r--src/devices/bus/pet/cb2snd.cpp14
-rw-r--r--src/devices/bus/pet/cb2snd.h2
-rw-r--r--src/devices/bus/plus4/sid.cpp6
-rw-r--r--src/devices/bus/plus4/sid.h1
-rw-r--r--src/devices/machine/mc6846.cpp4
-rw-r--r--src/devices/machine/mc6846.h6
-rw-r--r--src/devices/machine/s3c2400.cpp1
-rw-r--r--src/devices/machine/s3c2410.cpp1
-rw-r--r--src/devices/machine/s3c2440.cpp1
-rw-r--r--src/devices/machine/s3c44b0.cpp1
-rw-r--r--src/devices/sound/ad1848.cpp30
-rw-r--r--src/devices/sound/ad1848.h4
-rw-r--r--src/devices/sound/dac.cpp92
-rw-r--r--src/devices/sound/dac.h323
-rw-r--r--src/devices/sound/mea8000.cpp (renamed from src/mame/audio/mea8000.cpp)50
-rw-r--r--src/devices/sound/mea8000.h (renamed from src/mame/audio/mea8000.h)12
-rw-r--r--src/devices/sound/volt_reg.cpp33
-rw-r--r--src/devices/sound/volt_reg.h44
-rw-r--r--src/emu/disound.h2
-rw-r--r--src/frontend/mame/info.cpp2
-rw-r--r--src/frontend/mame/ui/devopt.cpp2
-rw-r--r--src/frontend/mame/ui/info.cpp2
-rw-r--r--src/mame/audio/alesis.cpp12
-rw-r--r--src/mame/audio/cchasm.cpp12
-rw-r--r--src/mame/audio/cclimber.cpp4
-rw-r--r--src/mame/audio/cyberbal.cpp11
-rw-r--r--src/mame/audio/galaxian.cpp8
-rw-r--r--src/mame/audio/gottlieb.cpp54
-rw-r--r--src/mame/audio/gottlieb.h19
-rw-r--r--src/mame/audio/harddriv.cpp20
-rw-r--r--src/mame/audio/hyprolyb.cpp2
-rw-r--r--src/mame/audio/jaguar.cpp4
-rw-r--r--src/mame/audio/leland.cpp389
-rw-r--r--src/mame/audio/m72.cpp4
-rw-r--r--src/mame/audio/m72.h2
-rw-r--r--src/mame/audio/meadows.cpp24
-rw-r--r--src/mame/audio/midway.cpp42
-rw-r--r--src/mame/audio/midway.h22
-rw-r--r--src/mame/audio/n8080.cpp41
-rw-r--r--src/mame/audio/s11c_bg.cpp33
-rw-r--r--src/mame/audio/s11c_bg.h15
-rw-r--r--src/mame/audio/segag80r.cpp20
-rw-r--r--src/mame/audio/segasnd.cpp2
-rw-r--r--src/mame/audio/segasnd.h4
-rw-r--r--src/mame/audio/senjyo.cpp2
-rw-r--r--src/mame/audio/spacefb.cpp13
-rw-r--r--src/mame/audio/targ.cpp23
-rw-r--r--src/mame/audio/williams.cpp33
-rw-r--r--src/mame/audio/williams.h13
-rw-r--r--src/mame/audio/wpcsnd.cpp34
-rw-r--r--src/mame/audio/wpcsnd.h15
-rw-r--r--src/mame/audio/zaccaria.cpp9
-rw-r--r--src/mame/audio/zaccaria.h6
-rw-r--r--src/mame/audio/zaxxon.cpp4
-rw-r--r--src/mame/drivers/20pacgal.cpp16
-rw-r--r--src/mame/drivers/4004clk.cpp18
-rw-r--r--src/mame/drivers/40love.cpp57
-rw-r--r--src/mame/drivers/a310.cpp52
-rw-r--r--src/mame/drivers/advision.cpp10
-rw-r--r--src/mame/drivers/alpha68k.cpp97
-rw-r--r--src/mame/drivers/amaticmg.cpp18
-rw-r--r--src/mame/drivers/apple3.cpp15
-rw-r--r--src/mame/drivers/applix.cpp27
-rw-r--r--src/mame/drivers/aristmk5.cpp93
-rw-r--r--src/mame/drivers/armedf.cpp122
-rw-r--r--src/mame/drivers/atari400.cpp23
-rw-r--r--src/mame/drivers/atari_s1.cpp14
-rw-r--r--src/mame/drivers/atari_s2.cpp26
-rw-r--r--src/mame/drivers/barata.cpp11
-rw-r--r--src/mame/drivers/barni.cpp1
-rw-r--r--src/mame/drivers/beezer.cpp7
-rw-r--r--src/mame/drivers/bking.cpp18
-rw-r--r--src/mame/drivers/blitz68k.cpp29
-rw-r--r--src/mame/drivers/bw12.cpp13
-rw-r--r--src/mame/drivers/bwing.cpp18
-rw-r--r--src/mame/drivers/by6803.cpp6
-rw-r--r--src/mame/drivers/byvid.cpp13
-rw-r--r--src/mame/drivers/c128.cpp13
-rw-r--r--src/mame/drivers/calchase.cpp49
-rw-r--r--src/mame/drivers/camplynx.cpp16
-rw-r--r--src/mame/drivers/capbowl.cpp20
-rw-r--r--src/mame/drivers/cbm2.cpp1
-rw-r--r--src/mame/drivers/cc40.cpp28
-rw-r--r--src/mame/drivers/cchasm.cpp22
-rw-r--r--src/mame/drivers/cclimber.cpp14
-rw-r--r--src/mame/drivers/champbas.cpp62
-rw-r--r--src/mame/drivers/cheekyms.cpp27
-rw-r--r--src/mame/drivers/chsuper.cpp12
-rw-r--r--src/mame/drivers/circusc.cpp13
-rw-r--r--src/mame/drivers/cntsteer.cpp25
-rw-r--r--src/mame/drivers/coco12.cpp14
-rw-r--r--src/mame/drivers/coolpool.cpp34
-rw-r--r--src/mame/drivers/cosmic.cpp101
-rw-r--r--src/mame/drivers/craft.cpp12
-rw-r--r--src/mame/drivers/csplayh5.cpp56
-rw-r--r--src/mame/drivers/cubeqst.cpp98
-rw-r--r--src/mame/drivers/cvs.cpp33
-rw-r--r--src/mame/drivers/cyberbal.cpp13
-rw-r--r--src/mame/drivers/dacholer.cpp1
-rw-r--r--src/mame/drivers/dambustr.cpp2
-rw-r--r--src/mame/drivers/dectalk.cpp12
-rw-r--r--src/mame/drivers/dragon.cpp2
-rw-r--r--src/mame/drivers/equites.cpp51
-rw-r--r--src/mame/drivers/ertictac.cpp51
-rw-r--r--src/mame/drivers/esripsys.cpp34
-rw-r--r--src/mame/drivers/exterm.cpp30
-rw-r--r--src/mame/drivers/famibox.cpp1
-rw-r--r--src/mame/drivers/fantland.cpp42
-rw-r--r--src/mame/drivers/fidel6502.cpp73
-rw-r--r--src/mame/drivers/fidel68k.cpp13
-rw-r--r--src/mame/drivers/fidelz80.cpp29
-rw-r--r--src/mame/drivers/finalizr.cpp20
-rw-r--r--src/mame/drivers/flstory.cpp105
-rw-r--r--src/mame/drivers/fruitpc.cpp1
-rw-r--r--src/mame/drivers/galaxian.cpp59
-rw-r--r--src/mame/drivers/galaxold.cpp17
-rw-r--r--src/mame/drivers/galeb.cpp53
-rw-r--r--src/mame/drivers/galivan.cpp37
-rw-r--r--src/mame/drivers/gamecom.cpp19
-rw-r--r--src/mame/drivers/gba.cpp62
-rw-r--r--src/mame/drivers/gei.cpp17
-rw-r--r--src/mame/drivers/go2000.cpp12
-rw-r--r--src/mame/drivers/gottlieb.cpp27
-rw-r--r--src/mame/drivers/gp32.cpp16
-rw-r--r--src/mame/drivers/gts80.cpp16
-rw-r--r--src/mame/drivers/gts80a.cpp12
-rw-r--r--src/mame/drivers/gts80b.cpp12
-rw-r--r--src/mame/drivers/hankin.cpp15
-rw-r--r--src/mame/drivers/harddriv.cpp84
-rw-r--r--src/mame/drivers/hh_cop400.cpp147
-rw-r--r--src/mame/drivers/homedata.cpp78
-rw-r--r--src/mame/drivers/homelab.cpp57
-rw-r--r--src/mame/drivers/hp48.cpp12
-rw-r--r--src/mame/drivers/hyhoo.cpp17
-rw-r--r--src/mame/drivers/hyperspt.cpp32
-rw-r--r--src/mame/drivers/indy_indigo2.cpp10
-rw-r--r--src/mame/drivers/iris3130.cpp6
-rw-r--r--src/mame/drivers/jaguar.cpp33
-rw-r--r--src/mame/drivers/jankenmn.cpp12
-rw-r--r--src/mame/drivers/joctronic.cpp1
-rw-r--r--src/mame/drivers/juicebox.cpp20
-rw-r--r--src/mame/drivers/junofrst.cpp22
-rw-r--r--src/mame/drivers/kchamp.cpp29
-rw-r--r--src/mame/drivers/kim1.cpp5
-rw-r--r--src/mame/drivers/kingobox.cpp25
-rw-r--r--src/mame/drivers/ksayakyu.cpp16
-rw-r--r--src/mame/drivers/laserbat.cpp12
-rw-r--r--src/mame/drivers/lasso.cpp22
-rw-r--r--src/mame/drivers/lazercmd.cpp60
-rw-r--r--src/mame/drivers/leland.cpp58
-rw-r--r--src/mame/drivers/littlerb.cpp32
-rw-r--r--src/mame/drivers/looping.cpp18
-rw-r--r--src/mame/drivers/m72.cpp24
-rw-r--r--src/mame/drivers/m90.cpp20
-rw-r--r--src/mame/drivers/mac.cpp38
-rw-r--r--src/mame/drivers/magicfly.cpp17
-rw-r--r--src/mame/drivers/mappy.cpp28
-rw-r--r--src/mame/drivers/matmania.cpp30
-rw-r--r--src/mame/drivers/mc10.cpp29
-rw-r--r--src/mame/drivers/mcr.cpp6
-rw-r--r--src/mame/drivers/mcr3.cpp8
-rw-r--r--src/mame/drivers/mcr68.cpp36
-rw-r--r--src/mame/drivers/meadows.cpp26
-rw-r--r--src/mame/drivers/megazone.cpp22
-rw-r--r--src/mame/drivers/meyc8080.cpp20
-rw-r--r--src/mame/drivers/meyc8088.cpp19
-rw-r--r--src/mame/drivers/microtan.cpp11
-rw-r--r--src/mame/drivers/microvsn.cpp31
-rw-r--r--src/mame/drivers/midtunit.cpp6
-rw-r--r--src/mame/drivers/midyunit.cpp26
-rw-r--r--src/mame/drivers/mikro80.cpp17
-rw-r--r--src/mame/drivers/mini2440.cpp26
-rw-r--r--src/mame/drivers/mjsister.cpp16
-rw-r--r--src/mame/drivers/mk14.cpp20
-rw-r--r--src/mame/drivers/mogura.cpp28
-rw-r--r--src/mame/drivers/mrgame.cpp25
-rw-r--r--src/mame/drivers/msx.cpp39
-rw-r--r--src/mame/drivers/multigam.cpp1
-rw-r--r--src/mame/drivers/murogem.cpp12
-rw-r--r--src/mame/drivers/murogmbl.cpp10
-rw-r--r--src/mame/drivers/namcos1.cpp58
-rw-r--r--src/mame/drivers/nbmj8688.cpp54
-rw-r--r--src/mame/drivers/nbmj8891.cpp46
-rw-r--r--src/mame/drivers/nbmj8900.cpp17
-rw-r--r--src/mame/drivers/nbmj8991.cpp40
-rw-r--r--src/mame/drivers/nbmj9195.cpp49
-rw-r--r--src/mame/drivers/ngp.cpp27
-rw-r--r--src/mame/drivers/niyanpai.cpp27
-rw-r--r--src/mame/drivers/notetaker.cpp22
-rw-r--r--src/mame/drivers/nycaptor.cpp84
-rw-r--r--src/mame/drivers/nyny.cpp28
-rw-r--r--src/mame/drivers/othello.cpp16
-rw-r--r--src/mame/drivers/palm.cpp29
-rw-r--r--src/mame/drivers/pandoras.cpp18
-rw-r--r--src/mame/drivers/pastelg.cpp35
-rw-r--r--src/mame/drivers/playch10.cpp1
-rw-r--r--src/mame/drivers/pocketc.cpp3
-rw-r--r--src/mame/drivers/pockstat.cpp23
-rw-r--r--src/mame/drivers/pong.cpp30
-rw-r--r--src/mame/drivers/ppmast93.cpp34
-rw-r--r--src/mame/drivers/quasar.cpp14
-rw-r--r--src/mame/drivers/quizshow.cpp13
-rw-r--r--src/mame/drivers/rastersp.cpp28
-rw-r--r--src/mame/drivers/replicator.cpp27
-rw-r--r--src/mame/drivers/rltennis.cpp19
-rw-r--r--src/mame/drivers/route16.cpp18
-rw-r--r--src/mame/drivers/rowamet.cpp13
-rw-r--r--src/mame/drivers/royalmah.cpp14
-rw-r--r--src/mame/drivers/s11.cpp43
-rw-r--r--src/mame/drivers/s11a.cpp29
-rw-r--r--src/mame/drivers/s11b.cpp29
-rw-r--r--src/mame/drivers/s11c.cpp39
-rw-r--r--src/mame/drivers/s3.cpp24
-rw-r--r--src/mame/drivers/s4.cpp22
-rw-r--r--src/mame/drivers/s6.cpp26
-rw-r--r--src/mame/drivers/s6a.cpp26
-rw-r--r--src/mame/drivers/s7.cpp27
-rw-r--r--src/mame/drivers/s8.cpp26
-rw-r--r--src/mame/drivers/s8a.cpp26
-rw-r--r--src/mame/drivers/s9.cpp27
-rw-r--r--src/mame/drivers/sbasketb.cpp25
-rw-r--r--src/mame/drivers/sbrkout.cpp14
-rw-r--r--src/mame/drivers/scramble.cpp1
-rw-r--r--src/mame/drivers/segag80r.cpp7
-rw-r--r--src/mame/drivers/segag80v.cpp10
-rw-r--r--src/mame/drivers/segas16a.cpp32
-rw-r--r--src/mame/drivers/segas24.cpp19
-rw-r--r--src/mame/drivers/seicross.cpp24
-rw-r--r--src/mame/drivers/senjyo.cpp18
-rw-r--r--src/mame/drivers/shangkid.cpp18
-rw-r--r--src/mame/drivers/shisen.cpp10
-rw-r--r--src/mame/drivers/spacefb.cpp2
-rw-r--r--src/mame/drivers/spaceg.cpp92
-rw-r--r--src/mame/drivers/special.cpp24
-rw-r--r--src/mame/drivers/ssozumo.cpp16
-rw-r--r--src/mame/drivers/ssystem3.cpp6
-rw-r--r--src/mame/drivers/suna16.cpp113
-rw-r--r--src/mame/drivers/suna8.cpp79
-rw-r--r--src/mame/drivers/tagteam.cpp17
-rw-r--r--src/mame/drivers/taito.cpp25
-rw-r--r--src/mame/drivers/taitosj.cpp66
-rw-r--r--src/mame/drivers/tceptor.cpp20
-rw-r--r--src/mame/drivers/terracre.cpp37
-rw-r--r--src/mame/drivers/thomson.cpp46
-rw-r--r--src/mame/drivers/tnzs.cpp62
-rw-r--r--src/mame/drivers/trackfld.cpp39
-rw-r--r--src/mame/drivers/truco.cpp23
-rw-r--r--src/mame/drivers/trucocl.cpp13
-rw-r--r--src/mame/drivers/tsamurai.cpp50
-rw-r--r--src/mame/drivers/tsispch.cpp11
-rw-r--r--src/mame/drivers/ut88.cpp15
-rw-r--r--src/mame/drivers/vcombat.cpp30
-rw-r--r--src/mame/drivers/vectrex.cpp18
-rw-r--r--src/mame/drivers/vg5k.cpp22
-rw-r--r--src/mame/drivers/vic10.cpp1
-rw-r--r--src/mame/drivers/vic20.cpp1
-rw-r--r--src/mame/drivers/vidbrain.cpp50
-rw-r--r--src/mame/drivers/videopkr.cpp16
-rw-r--r--src/mame/drivers/vigilant.cpp24
-rw-r--r--src/mame/drivers/vis.cpp44
-rw-r--r--src/mame/drivers/wheelfir.cpp212
-rw-r--r--src/mame/drivers/williams.cpp49
-rw-r--r--src/mame/drivers/wmg.cpp11
-rw-r--r--src/mame/drivers/wpc_an.cpp12
-rw-r--r--src/mame/drivers/wpc_dot.cpp5
-rw-r--r--src/mame/drivers/wpc_flip1.cpp5
-rw-r--r--src/mame/drivers/wpc_flip2.cpp5
-rw-r--r--src/mame/drivers/xtheball.cpp13
-rw-r--r--src/mame/drivers/zaccaria.cpp6
-rw-r--r--src/mame/drivers/zaxxon.cpp12
-rw-r--r--src/mame/includes/advision.h2
-rw-r--r--src/mame/includes/alesis.h2
-rw-r--r--src/mame/includes/apple2.h1
-rw-r--r--src/mame/includes/apple3.h14
-rw-r--r--src/mame/includes/archimds.h6
-rw-r--r--src/mame/includes/bw12.h2
-rw-r--r--src/mame/includes/cchasm.h5
-rw-r--r--src/mame/includes/champbas.h8
-rw-r--r--src/mame/includes/cheekyms.h19
-rw-r--r--src/mame/includes/circusc.h2
-rw-r--r--src/mame/includes/coco.h3
-rw-r--r--src/mame/includes/coolpool.h8
-rw-r--r--src/mame/includes/cosmic.h5
-rw-r--r--src/mame/includes/cvs.h4
-rw-r--r--src/mame/includes/cyberbal.h8
-rw-r--r--src/mame/includes/equites.h4
-rw-r--r--src/mame/includes/esripsys.h4
-rw-r--r--src/mame/includes/exidy.h2
-rw-r--r--src/mame/includes/exterm.h6
-rw-r--r--src/mame/includes/fidelz80.h6
-rw-r--r--src/mame/includes/galaxian.h2
-rw-r--r--src/mame/includes/galeb.h22
-rw-r--r--src/mame/includes/gamecom.h6
-rw-r--r--src/mame/includes/gba.h16
-rw-r--r--src/mame/includes/gp32.h8
-rw-r--r--src/mame/includes/harddriv.h11
-rw-r--r--src/mame/includes/homedata.h4
-rw-r--r--src/mame/includes/hp48.h2
-rw-r--r--src/mame/includes/jaguar.h8
-rw-r--r--src/mame/includes/kchamp.h3
-rw-r--r--src/mame/includes/kim1.h1
-rw-r--r--src/mame/includes/lazercmd.h11
-rw-r--r--src/mame/includes/leland.h37
-rw-r--r--src/mame/includes/m72.h2
-rw-r--r--src/mame/includes/mac.h9
-rw-r--r--src/mame/includes/mappy.h3
-rw-r--r--src/mame/includes/meadows.h5
-rw-r--r--src/mame/includes/mikro80.h4
-rw-r--r--src/mame/includes/msx.h2
-rw-r--r--src/mame/includes/n8080.h7
-rw-r--r--src/mame/includes/namcos1.h14
-rw-r--r--src/mame/includes/nbmj9195.h5
-rw-r--r--src/mame/includes/niyanpai.h5
-rw-r--r--src/mame/includes/rltennis.h8
-rw-r--r--src/mame/includes/s11.h15
-rw-r--r--src/mame/includes/segas24.h2
-rw-r--r--src/mame/includes/seicross.h5
-rw-r--r--src/mame/includes/senjyo.h2
-rw-r--r--src/mame/includes/sorcerer.h1
-rw-r--r--src/mame/includes/special.h2
-rw-r--r--src/mame/includes/suna16.h13
-rw-r--r--src/mame/includes/suna8.h1
-rw-r--r--src/mame/includes/taitosj.h12
-rw-r--r--src/mame/includes/tceptor.h4
-rw-r--r--src/mame/includes/thomson.h14
-rw-r--r--src/mame/includes/tnzs.h3
-rw-r--r--src/mame/includes/truco.h2
-rw-r--r--src/mame/includes/trucocl.h2
-rw-r--r--src/mame/includes/ut88.h2
-rw-r--r--src/mame/includes/vectrex.h2
-rw-r--r--src/mame/includes/vidbrain.h9
-rw-r--r--src/mame/includes/williams.h1
-rw-r--r--src/mame/machine/advision.cpp9
-rw-r--r--src/mame/machine/apple3.cpp20
-rw-r--r--src/mame/machine/archimds.cpp11
-rw-r--r--src/mame/machine/at.cpp1
-rw-r--r--src/mame/machine/coco.cpp4
-rw-r--r--src/mame/machine/gamecom.cpp10
-rw-r--r--src/mame/machine/harddriv.cpp13
-rw-r--r--src/mame/machine/hp48.cpp3
-rw-r--r--src/mame/machine/inder_sb.cpp95
-rw-r--r--src/mame/machine/inder_sb.h15
-rw-r--r--src/mame/machine/leland.cpp13
-rw-r--r--src/mame/machine/mac.cpp28
-rw-r--r--src/mame/machine/mega32x.cpp33
-rw-r--r--src/mame/machine/mega32x.h4
-rw-r--r--src/mame/machine/mikro80.cpp5
-rw-r--r--src/mame/machine/msx.cpp2
-rw-r--r--src/mame/machine/namcos1.cpp5
-rw-r--r--src/mame/machine/orao.cpp1
-rw-r--r--src/mame/machine/pc9801_86.cpp30
-rw-r--r--src/mame/machine/pc9801_86.h4
-rw-r--r--src/mame/machine/special.cpp2
-rw-r--r--src/mame/machine/thomson.cpp38
-rw-r--r--src/mame/machine/ut88.cpp3
-rw-r--r--src/mame/video/cheekyms.cpp12
-rw-r--r--src/mame/video/exterm.cpp1
-rw-r--r--src/mame/video/leland.cpp4
-rw-r--r--src/mame/video/vectrex.cpp2
392 files changed, 4427 insertions, 4519 deletions
diff --git a/src/devices/bus/a2bus/a2dx1.cpp b/src/devices/bus/a2bus/a2dx1.cpp
index 0cd70077cea..aa2281eff1e 100644
--- a/src/devices/bus/a2bus/a2dx1.cpp
+++ b/src/devices/bus/a2bus/a2dx1.cpp
@@ -8,9 +8,9 @@
*********************************************************************/
-#include "a2dx1.h"
#include "includes/apple2.h"
-#include "sound/dac.h"
+#include "a2dx1.h"
+#include "sound/volt_reg.h"
/***************************************************************************
PARAMETERS
@@ -22,12 +22,13 @@
const device_type A2BUS_DX1 = &device_creator<a2bus_dx1_device>;
-#define DAC_TAG "dac"
-
MACHINE_CONFIG_FRAGMENT( a2dx1 )
- MCFG_SPEAKER_STANDARD_MONO("dx1spkr")
- MCFG_SOUND_ADD(DAC_TAG, DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "dx1spkr", 1.00)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) // unknown DAC
+ MCFG_SOUND_ADD("dacvol", DAC_8BIT_R2R, 0) // unknown DAC
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dacvol", 1.0, DAC_VREF_POS_INPUT)
MACHINE_CONFIG_END
/***************************************************************************
@@ -51,14 +52,16 @@ machine_config_constructor a2bus_dx1_device::device_mconfig_additions() const
a2bus_dx1_device::a2bus_dx1_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
device_t(mconfig, type, name, tag, owner, clock, shortname, source),
device_a2bus_card_interface(mconfig, *this),
- m_dac(*this, DAC_TAG), m_volume(0), m_lastdac(0)
+ m_dac(*this, "dac"),
+ m_dacvol(*this, "dacvol")
{
}
a2bus_dx1_device::a2bus_dx1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
device_t(mconfig, A2BUS_DX1, "Decillonix DX-1", tag, owner, clock, "a2dx1", __FILE__),
device_a2bus_card_interface(mconfig, *this),
- m_dac(*this, DAC_TAG), m_volume(0), m_lastdac(0)
+ m_dac(*this, "dac"),
+ m_dacvol(*this, "dacvol")
{
}
@@ -70,14 +73,6 @@ void a2bus_dx1_device::device_start()
{
// set_a2bus_device makes m_slot valid
set_a2bus_device();
-
- save_item(NAME(m_volume));
- save_item(NAME(m_lastdac));
-}
-
-void a2bus_dx1_device::device_reset()
-{
- m_volume = m_lastdac = 0;
}
UINT8 a2bus_dx1_device::read_c0nx(address_space &space, UINT8 offset)
@@ -101,14 +96,12 @@ void a2bus_dx1_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data
{
switch (offset)
{
- case 5: // volume
- m_volume = data;
- m_dac->write_unsigned16(data*m_lastdac);
+ case 5:
+ m_dacvol->write(data);
break;
case 6:
- m_lastdac = data;
- m_dac->write_unsigned16(data*m_volume);
+ m_dac->write(data);
break;
}
}
diff --git a/src/devices/bus/a2bus/a2dx1.h b/src/devices/bus/a2bus/a2dx1.h
index ce349ab15d9..3dcf59e81e3 100644
--- a/src/devices/bus/a2bus/a2dx1.h
+++ b/src/devices/bus/a2bus/a2dx1.h
@@ -31,19 +31,16 @@ public:
// optional information overrides
virtual machine_config_constructor device_mconfig_additions() const override;
- required_device<dac_device> m_dac;
+ required_device<dac_byte_interface> m_dac;
+ required_device<dac_byte_interface> m_dacvol;
protected:
virtual void device_start() override;
- virtual void device_reset() override;
// overrides of standard a2bus slot functions
virtual UINT8 read_c0nx(address_space &space, UINT8 offset) override;
virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data) override;
virtual bool take_c800() override;
-
-private:
- UINT8 m_volume, m_lastdac;
};
// device type definition
diff --git a/src/devices/bus/a2bus/a2sam.cpp b/src/devices/bus/a2bus/a2sam.cpp
index 7cdabc64b74..4d106f99d98 100644
--- a/src/devices/bus/a2bus/a2sam.cpp
+++ b/src/devices/bus/a2bus/a2sam.cpp
@@ -8,9 +8,9 @@
*********************************************************************/
-#include "a2sam.h"
#include "includes/apple2.h"
-#include "sound/dac.h"
+#include "a2sam.h"
+#include "sound/volt_reg.h"
/***************************************************************************
PARAMETERS
@@ -22,12 +22,11 @@
const device_type A2BUS_SAM = &device_creator<a2bus_sam_device>;
-#define DAC_TAG "dac"
-
MACHINE_CONFIG_FRAGMENT( a2sam )
- MCFG_SPEAKER_STANDARD_MONO("samspkr")
- MCFG_SOUND_ADD(DAC_TAG, DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "samspkr", 1.00)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
/***************************************************************************
@@ -48,17 +47,10 @@ machine_config_constructor a2bus_sam_device::device_mconfig_additions() const
// LIVE DEVICE
//**************************************************************************
-a2bus_sam_device::a2bus_sam_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
- device_t(mconfig, type, name, tag, owner, clock, shortname, source),
- device_a2bus_card_interface(mconfig, *this),
- m_dac(*this, DAC_TAG)
-{
-}
-
a2bus_sam_device::a2bus_sam_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
device_t(mconfig, A2BUS_SAM, "Don't Ask Software SAM", tag, owner, clock, "a2sam", __FILE__),
device_a2bus_card_interface(mconfig, *this),
- m_dac(*this, DAC_TAG)
+ m_dac(*this, "dac")
{
}
@@ -78,7 +70,7 @@ void a2bus_sam_device::device_reset()
void a2bus_sam_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data)
{
- m_dac->write_unsigned8(data);
+ m_dac->write(data);
}
bool a2bus_sam_device::take_c800()
diff --git a/src/devices/bus/a2bus/a2sam.h b/src/devices/bus/a2bus/a2sam.h
index 5574a75c27c..cbf328454bd 100644
--- a/src/devices/bus/a2bus/a2sam.h
+++ b/src/devices/bus/a2bus/a2sam.h
@@ -25,13 +25,12 @@ class a2bus_sam_device:
{
public:
// construction/destruction
- a2bus_sam_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
a2bus_sam_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
// optional information overrides
virtual machine_config_constructor device_mconfig_additions() const override;
- required_device<dac_device> m_dac;
+ required_device<dac_byte_interface> m_dac;
protected:
virtual void device_start() override;
diff --git a/src/devices/bus/centronics/covox.cpp b/src/devices/bus/centronics/covox.cpp
index 71a89f66219..f8d4da11a6b 100644
--- a/src/devices/bus/centronics/covox.cpp
+++ b/src/devices/bus/centronics/covox.cpp
@@ -7,8 +7,8 @@
***************************************************************************/
#include "emu.h"
-#include "sound/dac.h"
#include "covox.h"
+#include "sound/volt_reg.h"
//**************************************************************************
// COVOX DEVICE
@@ -19,10 +19,10 @@ const device_type CENTRONICS_COVOX = &device_creator<centronics_covox_device>;
static MACHINE_CONFIG_FRAGMENT( covox )
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
-
- MCFG_SOUND_ADD("dac", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
@@ -59,7 +59,7 @@ void centronics_covox_device::device_start()
void centronics_covox_device::update_dac()
{
if (started())
- m_dac->write_unsigned8(m_data);
+ m_dac->write(m_data);
}
//**************************************************************************
@@ -72,12 +72,11 @@ const device_type CENTRONICS_COVOX_STEREO = &device_creator<centronics_covox_ste
static MACHINE_CONFIG_FRAGMENT( covox_stereo )
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
-
- MCFG_SOUND_ADD("dac_left", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
-
- MCFG_SOUND_ADD("dac_right", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
+ MCFG_SOUND_ADD("ldac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.5) // unknown DAC
+ MCFG_SOUND_ADD("rdac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.5) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "ldac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "ldac", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "rdac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "rdac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
@@ -91,9 +90,11 @@ MACHINE_CONFIG_END
centronics_covox_stereo_device::centronics_covox_stereo_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, CENTRONICS_COVOX_STEREO, "Covox (Stereo-in-1)", tag, owner, clock, "covox_stereo", __FILE__),
device_centronics_peripheral_interface( mconfig, *this ),
- m_dac_left(*this, "dac_left"),
- m_dac_right(*this, "dac_right"), m_strobe(0),
- m_data(0), m_autofd(0)
+ m_ldac(*this, "ldac"),
+ m_rdac(*this, "rdac"),
+ m_strobe(0),
+ m_data(0),
+ m_autofd(0)
{
}
@@ -119,9 +120,9 @@ void centronics_covox_stereo_device::update_dac()
if (started())
{
if (m_strobe)
- m_dac_left->write_unsigned8(m_data);
+ m_ldac->write(m_data);
if (m_autofd)
- m_dac_right->write_unsigned8(m_data);
+ m_rdac->write(m_data);
}
}
diff --git a/src/devices/bus/centronics/covox.h b/src/devices/bus/centronics/covox.h
index 68eeff2212f..527c8d8e398 100644
--- a/src/devices/bus/centronics/covox.h
+++ b/src/devices/bus/centronics/covox.h
@@ -40,7 +40,7 @@ protected:
virtual DECLARE_WRITE_LINE_MEMBER( input_data7 ) override { if (state) m_data |= 0x80; else m_data &= ~0x80; update_dac(); }
private:
- required_device<dac_device> m_dac;
+ required_device<dac_byte_interface> m_dac;
void update_dac();
@@ -78,8 +78,8 @@ protected:
virtual DECLARE_WRITE_LINE_MEMBER( input_autofd ) override { m_autofd = state; update_dac(); }
private:
- required_device<dac_device> m_dac_left;
- required_device<dac_device> m_dac_right;
+ required_device<dac_byte_interface> m_ldac;
+ required_device<dac_byte_interface> m_rdac;
void update_dac();
diff --git a/src/devices/bus/centronics/digiblst.cpp b/src/devices/bus/centronics/digiblst.cpp
index 9fdbfd5c279..1b7ed87ce2f 100644
--- a/src/devices/bus/centronics/digiblst.cpp
+++ b/src/devices/bus/centronics/digiblst.cpp
@@ -7,8 +7,8 @@
*/
#include "emu.h"
-#include "sound/dac.h"
#include "digiblst.h"
+#include "sound/volt_reg.h"
//**************************************************************************
// COVOX DEVICE
@@ -19,10 +19,10 @@ const device_type CENTRONICS_DIGIBLASTER = &device_creator<centronics_digiblaste
static MACHINE_CONFIG_FRAGMENT( digiblst )
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
-
- MCFG_SOUND_ADD("dac", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
@@ -59,5 +59,5 @@ void centronics_digiblaster_device::device_start()
void centronics_digiblaster_device::update_dac()
{
if (started())
- m_dac->write_unsigned8(m_data);
+ m_dac->write(m_data);
}
diff --git a/src/devices/bus/centronics/digiblst.h b/src/devices/bus/centronics/digiblst.h
index cec32eef1e9..6bf4956ee47 100644
--- a/src/devices/bus/centronics/digiblst.h
+++ b/src/devices/bus/centronics/digiblst.h
@@ -46,7 +46,7 @@ protected:
virtual DECLARE_WRITE_LINE_MEMBER( input_strobe ) override { if (state) m_data &= ~0x80; else m_data |= 0x80; update_dac(); }
private:
- required_device<dac_device> m_dac;
+ required_device<dac_byte_interface> m_dac;
void update_dac();
diff --git a/src/devices/bus/centronics/epson_lx810l.cpp b/src/devices/bus/centronics/epson_lx810l.cpp
index 1ceeb810caf..a4578a312d8 100644
--- a/src/devices/bus/centronics/epson_lx810l.cpp
+++ b/src/devices/bus/centronics/epson_lx810l.cpp
@@ -26,6 +26,8 @@
*/
#include "epson_lx810l.h"
+#include "sound/volt_reg.h"
+
//extern const char layout_lx800[]; /* use layout from lx800 */
//#define LX810LDEBUG
@@ -130,7 +132,7 @@ static MACHINE_CONFIG_FRAGMENT( epson_lx810l )
MCFG_UPD7810_AN6(READ8(epson_lx810l_t, an6_r))
MCFG_UPD7810_AN7(READ8(epson_lx810l_t, an7_r))
MCFG_UPD7810_CO0(WRITELINE(epson_lx810l_t, co0_w))
- MCFG_UPD7810_CO1(WRITELINE(epson_lx810l_t, co1_w))
+ MCFG_UPD7810_CO1(DEVWRITELINE("dac", dac_bit_interface, write))
// MCFG_DEFAULT_LAYOUT(layout_lx800)
@@ -143,9 +145,10 @@ static MACHINE_CONFIG_FRAGMENT( epson_lx810l )
MCFG_SCREEN_UPDATE_DRIVER(epson_lx810l_t, screen_update_lx810l)
/* audio hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT)
/* gate array */
MCFG_DEVICE_ADD("e05a30", E05A30, 0)
@@ -292,7 +295,6 @@ epson_lx810l_t::epson_lx810l_t(const machine_config &mconfig, const char *tag, d
m_pf_stepper(*this, "pf_stepper"),
m_cr_stepper(*this, "cr_stepper"),
m_eeprom(*this, "eeprom"),
- m_dac(*this, "dac"),
m_e05a30(*this, "e05a30"),
m_screen(*this, "screen"),
m_93c06_clk(0),
@@ -313,7 +315,6 @@ epson_lx810l_t::epson_lx810l_t(const machine_config &mconfig, device_type type,
m_pf_stepper(*this, "pf_stepper"),
m_cr_stepper(*this, "cr_stepper"),
m_eeprom(*this, "eeprom"),
- m_dac(*this, "dac"),
m_e05a30(*this, "e05a30"),
m_screen(*this, "screen"),
m_93c06_clk(0),
@@ -352,7 +353,6 @@ void epson_lx810l_t::device_start()
void epson_lx810l_t::device_reset()
{
- m_dac->write_unsigned8(0);
}
@@ -602,11 +602,6 @@ WRITE_LINE_MEMBER( epson_lx810l_t::co0_w )
}
}
-WRITE_LINE_MEMBER( epson_lx810l_t::co1_w )
-{
- m_dac->write_unsigned8(0 - !state);
-}
-
/***************************************************************************
ADC
diff --git a/src/devices/bus/centronics/epson_lx810l.h b/src/devices/bus/centronics/epson_lx810l.h
index 6a58929a405..aa3fb556d2a 100644
--- a/src/devices/bus/centronics/epson_lx810l.h
+++ b/src/devices/bus/centronics/epson_lx810l.h
@@ -60,7 +60,6 @@ public:
/* Extended Timer Output */
DECLARE_WRITE_LINE_MEMBER(co0_w);
- DECLARE_WRITE_LINE_MEMBER(co1_w);
/* ADC */
DECLARE_READ8_MEMBER(an0_r);
@@ -117,7 +116,6 @@ private:
required_device<stepper_device> m_pf_stepper;
required_device<stepper_device> m_cr_stepper;
required_device<eeprom_serial_93cxx_device> m_eeprom;
- required_device<dac_device> m_dac;
required_device<e05a30_device> m_e05a30;
required_device<screen_device> m_screen;
diff --git a/src/devices/bus/coco/coco_orch90.cpp b/src/devices/bus/coco/coco_orch90.cpp
index 8f02d8612db..e81b585dfc2 100644
--- a/src/devices/bus/coco/coco_orch90.cpp
+++ b/src/devices/bus/coco/coco_orch90.cpp
@@ -14,14 +14,15 @@
#include "emu.h"
#include "coco_orch90.h"
-#include "sound/dac.h"
+#include "sound/volt_reg.h"
static MACHINE_CONFIG_FRAGMENT(coco_orch90)
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
- MCFG_SOUND_ADD("dac_left", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_SOUND_ADD("dac_right", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
+ MCFG_SOUND_ADD("ldac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.5) // ls374.ic5 + r7 (8x20k) + r9 (8x10k)
+ MCFG_SOUND_ADD("rdac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.5) // ls374.ic4 + r6 (8x20k) + r8 (8x10k)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "ldac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "ldac", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "rdac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "rdac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
//**************************************************************************
@@ -40,8 +41,10 @@ const device_type COCO_ORCH90 = &device_creator<coco_orch90_device>;
coco_orch90_device::coco_orch90_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, COCO_ORCH90, "CoCo Orch-90 PAK", tag, owner, clock, "coco_orch90", __FILE__),
- device_cococart_interface( mconfig, *this ), m_left_dac(nullptr), m_right_dac(nullptr)
- {
+ device_cococart_interface(mconfig, *this ),
+ m_ldac(*this, "ldac"),
+ m_rdac(*this, "rdac")
+{
}
//-------------------------------------------------
@@ -50,8 +53,6 @@ coco_orch90_device::coco_orch90_device(const machine_config &mconfig, const char
void coco_orch90_device::device_start()
{
- m_left_dac = subdevice<dac_device>("dac_left");
- m_right_dac = subdevice<dac_device>("dac_right");
}
//-------------------------------------------------
@@ -73,13 +74,11 @@ WRITE8_MEMBER(coco_orch90_device::write)
switch(offset)
{
case 0x3A:
- /* left channel write */
- m_left_dac->write_unsigned8(data);
+ m_ldac->write(data);
break;
case 0x3B:
- /* right channel write */
- m_right_dac->write_unsigned8(data);
+ m_rdac->write(data);
break;
}
}
diff --git a/src/devices/bus/coco/coco_orch90.h b/src/devices/bus/coco/coco_orch90.h
index 0dcc521ba85..a3554d63868 100644
--- a/src/devices/bus/coco/coco_orch90.h
+++ b/src/devices/bus/coco/coco_orch90.h
@@ -31,8 +31,8 @@ protected:
virtual DECLARE_WRITE8_MEMBER(write) override;
private:
// internal state
- dac_device *m_left_dac;
- dac_device *m_right_dac;
+ required_device<dac_byte_interface> m_ldac;
+ required_device<dac_byte_interface> m_rdac;
};
diff --git a/src/devices/bus/cpc/amdrum.cpp b/src/devices/bus/cpc/amdrum.cpp
index 6f8453e3750..072e7e117c4 100644
--- a/src/devices/bus/cpc/amdrum.cpp
+++ b/src/devices/bus/cpc/amdrum.cpp
@@ -7,8 +7,9 @@
*/
#include "emu.h"
-#include "amdrum.h"
#include "includes/amstrad.h"
+#include "amdrum.h"
+#include "sound/volt_reg.h"
//**************************************************************************
@@ -19,9 +20,10 @@ const device_type CPC_AMDRUM = &device_creator<cpc_amdrum_device>;
static MACHINE_CONFIG_FRAGMENT( cpc_amdrum )
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
// no pass-through
MACHINE_CONFIG_END
@@ -66,5 +68,5 @@ void cpc_amdrum_device::device_reset()
WRITE8_MEMBER(cpc_amdrum_device::dac_w)
{
- m_dac->write_unsigned8(data);
+ m_dac->write(data);
}
diff --git a/src/devices/bus/cpc/amdrum.h b/src/devices/bus/cpc/amdrum.h
index 5a3df11d273..9f0b753f763 100644
--- a/src/devices/bus/cpc/amdrum.h
+++ b/src/devices/bus/cpc/amdrum.h
@@ -38,7 +38,7 @@ protected:
private:
cpc_expansion_slot_device *m_slot;
- required_device<dac_device> m_dac;
+ required_device<dac_byte_interface> m_dac;
};
// device type definition
diff --git a/src/devices/bus/cpc/magicsound.cpp b/src/devices/bus/cpc/magicsound.cpp
index 6f9a6313a64..711c7978aa3 100644
--- a/src/devices/bus/cpc/magicsound.cpp
+++ b/src/devices/bus/cpc/magicsound.cpp
@@ -8,8 +8,9 @@
*/
#include "emu.h"
-#include "magicsound.h"
#include "includes/amstrad.h"
+#include "magicsound.h"
+#include "sound/volt_reg.h"
//**************************************************************************
@@ -55,9 +56,10 @@ static MACHINE_CONFIG_FRAGMENT( al_magicsound )
MCFG_PIT8253_OUT1_HANDLER(WRITELINE(al_magicsound_device,da0_w))
MCFG_PIT8253_CLK2(XTAL_4MHz)
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DAC_ADD("dac1")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
// no pass-through(?)
MACHINE_CONFIG_END
@@ -73,7 +75,7 @@ machine_config_constructor al_magicsound_device::device_mconfig_additions() cons
al_magicsound_device::al_magicsound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
device_t(mconfig, AL_MAGICSOUND, "Magic Sound Board", tag, owner, clock, "al_magicsound", __FILE__),
device_cpc_expansion_card_interface(mconfig, *this), m_slot(nullptr),
- m_dac1(*this,"dac1"),
+ m_dac(*this,"dac"),
m_dmac(*this,"dmac"),
m_timer1(*this,"timer1"),
m_timer2(*this,"timer2"), m_current_channel(0), m_ramptr(nullptr), m_current_output(0)
@@ -148,7 +150,7 @@ WRITE8_MEMBER(al_magicsound_device::mapper_w)
WRITE_LINE_MEMBER(al_magicsound_device::da0_w)
{
- m_dac1->write_unsigned8(m_output[m_current_output++]);
+ m_dac->write(m_output[m_current_output++]);
if(m_current_output > 3)
m_current_output = 0;
}
diff --git a/src/devices/bus/cpc/magicsound.h b/src/devices/bus/cpc/magicsound.h
index 519e820bac4..1c52a186f54 100644
--- a/src/devices/bus/cpc/magicsound.h
+++ b/src/devices/bus/cpc/magicsound.h
@@ -68,7 +68,7 @@ protected:
private:
cpc_expansion_slot_device *m_slot;
- required_device<dac_device> m_dac1;
+ required_device<dac_byte_interface> m_dac;
required_device<am9517a_device> m_dmac;
required_device<pit8254_device> m_timer1;
required_device<pit8254_device> m_timer2;
diff --git a/src/devices/bus/isa/dectalk.cpp b/src/devices/bus/isa/dectalk.cpp
index a59d0b07b1d..10f8bdb58f4 100644
--- a/src/devices/bus/isa/dectalk.cpp
+++ b/src/devices/bus/isa/dectalk.cpp
@@ -1,6 +1,7 @@
// license:BSD-3-Clause
// copyright-holders:Carl
#include "dectalk.h"
+#include "sound/volt_reg.h"
const device_type ISA8_DECTALK = &device_creator<dectalk_isa_device>;
@@ -61,7 +62,7 @@ WRITE8_MEMBER(dectalk_isa_device::dma_w)
WRITE16_MEMBER(dectalk_isa_device::dac_w)
{
- m_dac->write(data & 0xfff0);
+ m_dac->write(data >> 4);
}
WRITE16_MEMBER(dectalk_isa_device::output_ctl_w)
@@ -147,8 +148,9 @@ static MACHINE_CONFIG_FRAGMENT( dectalk_isa )
MCFG_CPU_PROGRAM_MAP(dectalk_dsp_map)
MCFG_SPEAKER_STANDARD_MONO("speaker")
- MCFG_SOUND_ADD("dac", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.00)
+ MCFG_SOUND_ADD("dac", DAC_12BIT_R2R, 0) MCFG_SOUND_ROUTE(0, "speaker", 1.0) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
ROM_START( dectalk_isa )
diff --git a/src/devices/bus/isa/dectalk.h b/src/devices/bus/isa/dectalk.h
index 204fdffb487..971d8915e96 100644
--- a/src/devices/bus/isa/dectalk.h
+++ b/src/devices/bus/isa/dectalk.h
@@ -47,7 +47,7 @@ private:
UINT8 m_dma, m_vol, m_bio;
required_device<i80186_cpu_device> m_cpu;
- required_device<dac_device> m_dac;
+ required_device<dac_12bit_r2r_device> m_dac;
required_device<cpu_device> m_dsp;
};
diff --git a/src/devices/bus/isa/p1_sound.cpp b/src/devices/bus/isa/p1_sound.cpp
index 03499c77643..e77312a3fd9 100644
--- a/src/devices/bus/isa/p1_sound.cpp
+++ b/src/devices/bus/isa/p1_sound.cpp
@@ -12,6 +12,7 @@
**********************************************************************/
#include "p1_sound.h"
+#include "sound/volt_reg.h"
//**************************************************************************
// DEVICE DEFINITIONS
@@ -59,11 +60,12 @@ static MACHINE_CONFIG_FRAGMENT( p1_sound )
MCFG_PIT8253_CLK2(XTAL_12_5MHz/10)
// MCFG_PIT8253_OUT2_HANDLER(XXX)
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "filter", 1.0)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_FILTER_RC_ADD("filter", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "filter", 0.5) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
@@ -143,7 +145,7 @@ WRITE8_MEMBER( p1_sound_device::dac_w )
WRITE_LINE_MEMBER( p1_sound_device::sampler_sync )
{
if (state) {
- m_dac->write_unsigned8(m_dac_data[m_dac_ptr++]);
+ m_dac->write(m_dac_data[m_dac_ptr++]);
m_dac_ptr &= 7;
if ((m_dac_ptr % 8) == 0) {
m_isa->irq7_w(state);
diff --git a/src/devices/bus/isa/p1_sound.h b/src/devices/bus/isa/p1_sound.h
index 95a6878f395..2dfae20f67c 100644
--- a/src/devices/bus/isa/p1_sound.h
+++ b/src/devices/bus/isa/p1_sound.h
@@ -57,7 +57,7 @@ private:
UINT8 m_dac_data[16];
int m_dac_ptr;
- required_device<dac_device> m_dac;
+ required_device<dac_byte_interface> m_dac;
optional_device<filter_rc_device> m_filter;
required_device<i8251_device> m_midi;
required_device<pit8253_device> m_d14;
diff --git a/src/devices/bus/isa/sb16.cpp b/src/devices/bus/isa/sb16.cpp
index 9378da64858..3b65ef23894 100644
--- a/src/devices/bus/isa/sb16.cpp
+++ b/src/devices/bus/isa/sb16.cpp
@@ -55,8 +55,8 @@ READ8_MEMBER( sb16_lle_device::adc_data_r )
WRITE8_MEMBER( sb16_lle_device::dac_data_w )
{
- m_dacl->write_unsigned8(data);
- m_dacr->write_unsigned8(data);
+ m_ldac->write(data << 8);
+ m_rdac->write(data << 8);
}
READ8_MEMBER( sb16_lle_device::p1_r )
@@ -412,10 +412,8 @@ static MACHINE_CONFIG_FRAGMENT( sb16 )
MCFG_SOUND_ROUTE(2, "lspeaker", 1.00)
MCFG_SOUND_ROUTE(3, "rspeaker", 1.00)
- MCFG_SOUND_ADD("dacl", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.00)
- MCFG_SOUND_ADD("dacr", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.00)
+ MCFG_SOUND_ADD("ldac", DAC_16BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.5) // unknown DAC
+ MCFG_SOUND_ADD("rdac", DAC_16BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.5) // unknown DAC
MCFG_PC_JOY_ADD("pc_joy")
MACHINE_CONFIG_END
@@ -681,8 +679,8 @@ WRITE8_MEMBER( sb16_lle_device::mpu401_w )
sb16_lle_device::sb16_lle_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
device_t(mconfig, ISA16_SB16, "SoundBlaster 16 Audio Adapter LLE", tag, owner, clock, "sb16", __FILE__),
device_isa16_card_interface(mconfig, *this),
- m_dacl(*this, "dacl"),
- m_dacr(*this, "dacr"),
+ m_ldac(*this, "ldac"),
+ m_rdac(*this, "rdac"),
m_joy(*this, "pc_joy"),
m_cpu(*this, "sb16_cpu"), m_data_in(false), m_in_byte(0), m_data_out(false), m_out_byte(0), m_freq(0), m_mode(0), m_dac_fifo_ctrl(0), m_adc_fifo_ctrl(0), m_ctrl8(0), m_ctrl16(0), m_mpu_byte(0),
m_dma8_len(0), m_dma16_len(0), m_dma8_cnt(0), m_dma16_cnt(0), m_adc_fifo_head(0), m_adc_fifo_tail(0), m_dac_fifo_head(0), m_dac_fifo_tail(0), m_adc_r(false), m_dac_r(false), m_adc_h(false),
@@ -754,21 +752,21 @@ void sb16_lle_device::device_timer(emu_timer &timer, device_timer_id tid, int pa
switch(m_mode & 0xa0) // dac 16
{
case 0x00: // unsigned stereo
- dacl = (m_dac_fifo[m_dac_fifo_tail].h[0] - 0x8000);
- dacr = (m_dac_fifo[m_dac_fifo_tail].h[1] - 0x8000);
- break;
- case 0x20: // signed stereo
dacl = m_dac_fifo[m_dac_fifo_tail].h[0];
dacr = m_dac_fifo[m_dac_fifo_tail].h[1];
break;
- case 0x80: // unsigned mono
- dacl = (m_dac_fifo[m_dac_fifo_tail].h[0] - 0x8000);
- dacr = (m_dac_fifo[m_dac_fifo_tail].h[0] - 0x8000);
+ case 0x20: // signed stereo
+ dacl = (m_dac_fifo[m_dac_fifo_tail].h[0] ^ 0x8000);
+ dacr = (m_dac_fifo[m_dac_fifo_tail].h[1] ^ 0x8000);
break;
- case 0xa0: // signed mono
+ case 0x80: // unsigned mono
dacl = m_dac_fifo[m_dac_fifo_tail].h[0];
dacr = m_dac_fifo[m_dac_fifo_tail].h[0];
break;
+ case 0xa0: // signed mono
+ dacl = (m_dac_fifo[m_dac_fifo_tail].h[0] ^ 0x8000);
+ dacr = (m_dac_fifo[m_dac_fifo_tail].h[0] ^ 0x8000);
+ break;
}
switch(m_mode & 0x50) // adc 8; placeholder
{
@@ -795,21 +793,21 @@ void sb16_lle_device::device_timer(emu_timer &timer, device_timer_id tid, int pa
switch(m_mode & 0x50) // dac 8
{
case 0x00: // unsigned stereo
- dacl = (m_dac_fifo[m_dac_fifo_tail].b[0] - 0x80) << 8;
- dacr = (m_dac_fifo[m_dac_fifo_tail].b[2] - 0x80) << 8;
- break;
- case 0x10: // signed stereo
dacl = m_dac_fifo[m_dac_fifo_tail].b[0] << 8;
dacr = m_dac_fifo[m_dac_fifo_tail].b[2] << 8;
break;
- case 0x40: // unsigned mono
- dacl = (m_dac_fifo[m_dac_fifo_tail].b[0] - 0x80) << 8;
- dacr = (m_dac_fifo[m_dac_fifo_tail].b[0] - 0x80) << 8;
+ case 0x10: // signed stereo
+ dacl = (m_dac_fifo[m_dac_fifo_tail].b[0] ^ 0x80) << 8;
+ dacr = (m_dac_fifo[m_dac_fifo_tail].b[2] ^ 0x80) << 8;
break;
- case 0x50: // signed mono
+ case 0x40: // unsigned mono
dacl = m_dac_fifo[m_dac_fifo_tail].b[0] << 8;
dacr = m_dac_fifo[m_dac_fifo_tail].b[0] << 8;
break;
+ case 0x50: // signed mono
+ dacl = (m_dac_fifo[m_dac_fifo_tail].b[0] ^ 0x80) << 8;
+ dacr = (m_dac_fifo[m_dac_fifo_tail].b[0] ^ 0x80) << 8;
+ break;
}
switch(m_mode & 0xa0) // adc 16; placeholder
{
@@ -831,8 +829,8 @@ void sb16_lle_device::device_timer(emu_timer &timer, device_timer_id tid, int pa
break;
}
}
- m_dacr->write(dacr);
- m_dacl->write(dacl);
+ m_rdac->write(dacr);
+ m_ldac->write(dacl);
if(!(m_ctrl8 & 2))
m_isa->drq1_w(1);
diff --git a/src/devices/bus/isa/sb16.h b/src/devices/bus/isa/sb16.h
index 2d6811a5f78..44ac336e673 100644
--- a/src/devices/bus/isa/sb16.h
+++ b/src/devices/bus/isa/sb16.h
@@ -28,8 +28,8 @@ public:
virtual const tiny_rom_entry *device_rom_region() const override;
virtual machine_config_constructor device_mconfig_additions() const override;
- required_device<dac_device> m_dacl;
- required_device<dac_device> m_dacr;
+ required_device<dac_word_interface> m_ldac;
+ required_device<dac_word_interface> m_rdac;
required_device<pc_joy_device> m_joy;
required_device<cpu_device> m_cpu;
diff --git a/src/devices/bus/isa/sblaster.cpp b/src/devices/bus/isa/sblaster.cpp
index 6e38b04ce81..9f1c8382af9 100644
--- a/src/devices/bus/isa/sblaster.cpp
+++ b/src/devices/bus/isa/sblaster.cpp
@@ -12,10 +12,10 @@
***************************************************************************/
#include "sblaster.h"
+#include "machine/pic8259.h"
#include "sound/speaker.h"
#include "sound/262intf.h"
-#include "sound/dac.h"
-#include "machine/pic8259.h"
+#include "sound/volt_reg.h"
/*
adlib (YM3812/OPL2 chip), part of many many soundcards (soundblaster)
@@ -73,10 +73,11 @@ static MACHINE_CONFIG_FRAGMENT( sblaster1_0_config )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.50)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.50)
- MCFG_SOUND_ADD("sbdacl", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.00)
- MCFG_SOUND_ADD("sbdacr", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.00)
+ MCFG_SOUND_ADD("ldac", DAC_16BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.5) // unknown DAC
+ MCFG_SOUND_ADD("rdac", DAC_16BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.5) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "ldac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "ldac", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "rdac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "rdac", -1.0, DAC_VREF_NEG_INPUT)
MCFG_PC_JOY_ADD("pc_joy")
MCFG_MIDI_PORT_ADD("mdin", midiin_slot, "midiin")
@@ -92,10 +93,11 @@ static MACHINE_CONFIG_FRAGMENT( sblaster1_5_config )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.00)
/* no CM/S support (empty sockets) */
- MCFG_SOUND_ADD("sbdacl", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.00)
- MCFG_SOUND_ADD("sbdacr", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.00)
+ MCFG_SOUND_ADD("ldac", DAC_16BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.5) // unknown DAC
+ MCFG_SOUND_ADD("rdac", DAC_16BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.5) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "ldac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "ldac", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "rdac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "rdac", -1.0, DAC_VREF_NEG_INPUT)
MCFG_PC_JOY_ADD("pc_joy")
MCFG_MIDI_PORT_ADD("mdin", midiin_slot, "midiin")
@@ -111,10 +113,12 @@ static MACHINE_CONFIG_FRAGMENT( sblaster_16_config )
MCFG_SOUND_ROUTE(1, "rspeaker", 1.00)
MCFG_SOUND_ROUTE(2, "lspeaker", 1.00)
MCFG_SOUND_ROUTE(3, "rspeaker", 1.00)
- MCFG_SOUND_ADD("sbdacl", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.00)
- MCFG_SOUND_ADD("sbdacr", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.00)
+
+ MCFG_SOUND_ADD("ldac", DAC_16BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.5) // unknown DAC
+ MCFG_SOUND_ADD("rdac", DAC_16BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.5) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "ldac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "ldac", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "rdac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "rdac", -1.0, DAC_VREF_NEG_INPUT)
MCFG_PC_JOY_ADD("pc_joy")
MCFG_MIDI_PORT_ADD("mdin", midiin_slot, "midiin")
@@ -755,8 +759,8 @@ void sb_device::adpcm_decode(UINT8 sample, int size)
else if(dec_sample < 0)
dec_sample = 0;
m_dsp.adpcm_ref = dec_sample;
- m_dacl->write_unsigned8(m_dsp.adpcm_ref);
- m_dacr->write_unsigned8(m_dsp.adpcm_ref);
+ m_ldac->write(m_dsp.adpcm_ref << 8);
+ m_rdac->write(m_dsp.adpcm_ref << 8);
}
READ8_MEMBER( sb16_device::mpu401_r )
@@ -835,8 +839,8 @@ void sb16_device::mixer_set()
ymf262_device *ymf = subdevice<ymf262_device>("ymf262");
float lmain = m_mixer.main_vol[0]/248.0;
float rmain = m_mixer.main_vol[1]/248.0;
- m_dacl->set_output_gain(ALL_OUTPUTS, lmain*(m_mixer.dac_vol[0]/248.0f));
- m_dacr->set_output_gain(ALL_OUTPUTS, rmain*(m_mixer.dac_vol[1]/248.0f));
+ m_ldac->set_output_gain(ALL_OUTPUTS, lmain*(m_mixer.dac_vol[0]/248.0f));
+ m_rdac->set_output_gain(ALL_OUTPUTS, rmain*(m_mixer.dac_vol[1]/248.0f));
ymf->set_output_gain(0, lmain*(m_mixer.fm_vol[0]/248.0f));
ymf->set_output_gain(1, rmain*(m_mixer.fm_vol[1]/248.0f));
ymf->set_output_gain(2, lmain*(m_mixer.fm_vol[0]/248.0f));
@@ -1216,8 +1220,8 @@ machine_config_constructor isa16_sblaster16_device::device_mconfig_additions() c
sb_device::sb_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock, const char *name, const char *shortname, const char *source) :
device_t(mconfig, type, name, tag, owner, clock, shortname, source),
device_serial_interface(mconfig, *this),
- m_dacl(*this, "sbdacl"),
- m_dacr(*this, "sbdacr"),
+ m_ldac(*this, "ldac"),
+ m_rdac(*this, "rdac"),
m_joy(*this, "pc_joy"),
m_mdout(*this, "mdout"),
m_config(*this, "CONFIG"), m_dack_out(0), m_onebyte_midi(false), m_uart_midi(false), m_uart_irq(false), m_mpu_midi(false), m_rx_waiting(0), m_tx_waiting(0), m_xmit_read(0), m_xmit_write(0), m_recv_read(0), m_recv_write(0), m_tx_busy(false), m_timer(nullptr)
@@ -1540,40 +1544,40 @@ void sb_device::device_timer(emu_timer &timer, device_timer_id tid, int param, v
UINT16 lsample, rsample;
switch (m_dsp.flags) {
case 0: // 8-bit unsigned mono
- m_dacl->write_unsigned8(m_dsp.data[m_dsp.d_rptr]);
- m_dacr->write_unsigned8(m_dsp.data[m_dsp.d_rptr]);
+ m_ldac->write(m_dsp.data[m_dsp.d_rptr] << 8);
+ m_rdac->write(m_dsp.data[m_dsp.d_rptr] << 8);
m_dsp.data[m_dsp.d_rptr++] = 0x80;
break;
case SIGNED: // 8-bit signed mono
- m_dacl->write_unsigned8(m_dsp.data[m_dsp.d_rptr] + 128);
- m_dacr->write_unsigned8(m_dsp.data[m_dsp.d_rptr] + 128);
+ m_ldac->write((m_dsp.data[m_dsp.d_rptr] ^ 0x80) << 8);
+ m_rdac->write((m_dsp.data[m_dsp.d_rptr] ^ 0x80) << 8);
m_dsp.data[m_dsp.d_rptr++] = 0x00;
break;
case STEREO: // 8-bit unsigned stereo
- m_dacl->write_unsigned8(m_dsp.data[m_dsp.d_rptr]);
+ m_ldac->write(m_dsp.data[m_dsp.d_rptr] << 8);
m_dsp.data[m_dsp.d_rptr++] = 0x80;
- m_dacr->write_unsigned8(m_dsp.data[m_dsp.d_rptr]);
+ m_rdac->write(m_dsp.data[m_dsp.d_rptr] << 8);
m_dsp.data[m_dsp.d_rptr++] = 0x80;
break;
case SIGNED | STEREO: // 8-bit signed stereo
- m_dacl->write_unsigned8(m_dsp.data[m_dsp.d_rptr] + 128);
+ m_ldac->write((m_dsp.data[m_dsp.d_rptr] ^ 0x80) << 8);
m_dsp.data[m_dsp.d_rptr++] = 0x00;
- m_dacr->write_unsigned8(m_dsp.data[m_dsp.d_rptr] + 128);
+ m_rdac->write((m_dsp.data[m_dsp.d_rptr] ^ 0x80) << 8);
m_dsp.data[m_dsp.d_rptr++] = 0x00;
break;
case SIXTEENBIT: // 16-bit unsigned mono
lsample = m_dsp.data[m_dsp.d_rptr] | (m_dsp.data[m_dsp.d_rptr+1] << 8);
m_dsp.data[m_dsp.d_rptr++] = 0x00;
m_dsp.data[m_dsp.d_rptr++] = 0x80;
- m_dacl->write_unsigned16(lsample);
- m_dacr->write_unsigned16(lsample);
+ m_ldac->write(lsample);
+ m_rdac->write(lsample);
break;
case SIXTEENBIT | SIGNED: // 16-bit signed mono
- lsample = m_dsp.data[m_dsp.d_rptr] | (m_dsp.data[m_dsp.d_rptr+1] << 8);
+ lsample = m_dsp.data[m_dsp.d_rptr] | ((m_dsp.data[m_dsp.d_rptr+1] ^ 0x80) << 8);
m_dsp.data[m_dsp.d_rptr++] = 0x00;
m_dsp.data[m_dsp.d_rptr++] = 0x00;
- m_dacl->write_unsigned16(lsample + 32768);
- m_dacr->write_unsigned16(lsample + 32768);
+ m_ldac->write(lsample);
+ m_rdac->write(lsample);
break;
case SIXTEENBIT | STEREO: // 16-bit unsigned stereo
lsample = m_dsp.data[m_dsp.d_rptr] | (m_dsp.data[m_dsp.d_rptr+1] << 8);
@@ -1583,27 +1587,27 @@ void sb_device::device_timer(emu_timer &timer, device_timer_id tid, int param, v
rsample = m_dsp.data[m_dsp.d_rptr] | (m_dsp.data[m_dsp.d_rptr+1] << 8);
m_dsp.data[m_dsp.d_rptr++] = 0x00;
m_dsp.data[m_dsp.d_rptr++] = 0x80;
- m_dacl->write_unsigned16(lsample);
- m_dacr->write_unsigned16(rsample);
+ m_ldac->write(lsample);
+ m_rdac->write(rsample);
break;
case SIXTEENBIT | SIGNED | STEREO: // 16-bit signed stereo
- lsample = m_dsp.data[m_dsp.d_rptr] | (m_dsp.data[m_dsp.d_rptr+1] << 8);
+ lsample = m_dsp.data[m_dsp.d_rptr] | ((m_dsp.data[m_dsp.d_rptr+1] ^ 0x80) << 8);
m_dsp.data[m_dsp.d_rptr++] = 0x00;
m_dsp.data[m_dsp.d_rptr++] = 0x00;
m_dsp.d_rptr %= 128;
- rsample = m_dsp.data[m_dsp.d_rptr] | (m_dsp.data[m_dsp.d_rptr+1] << 8);
+ rsample = m_dsp.data[m_dsp.d_rptr] | ((m_dsp.data[m_dsp.d_rptr+1] ^ 0x80) << 8);
m_dsp.data[m_dsp.d_rptr++] = 0x00;
m_dsp.data[m_dsp.d_rptr++] = 0x00;
- m_dacl->write_unsigned16(lsample + 32768);
- m_dacr->write_unsigned16(rsample + 32768);
+ m_ldac->write(lsample);
+ m_rdac->write(rsample);
break;
case ADPCM2:
if(m_dsp.adpcm_new_ref)
{
m_dsp.adpcm_ref = m_dsp.data[m_dsp.d_rptr++];
m_dsp.adpcm_new_ref = false;
- m_dacl->write_unsigned8(m_dsp.adpcm_ref);
- m_dacr->write_unsigned8(m_dsp.adpcm_ref);
+ m_ldac->write(m_dsp.adpcm_ref << 8);
+ m_rdac->write(m_dsp.adpcm_ref << 8);
break;
}
lsample = m_dsp.data[m_dsp.d_rptr];
@@ -1630,8 +1634,8 @@ void sb_device::device_timer(emu_timer &timer, device_timer_id tid, int param, v
{
m_dsp.adpcm_ref = m_dsp.data[m_dsp.d_rptr++];
m_dsp.adpcm_new_ref = false;
- m_dacl->write_unsigned8(m_dsp.adpcm_ref);
- m_dacr->write_unsigned8(m_dsp.adpcm_ref);
+ m_ldac->write(m_dsp.adpcm_ref << 8);
+ m_rdac->write(m_dsp.adpcm_ref << 8);
break;
}
lsample = m_dsp.data[m_dsp.d_rptr];
@@ -1655,8 +1659,8 @@ void sb_device::device_timer(emu_timer &timer, device_timer_id tid, int param, v
{
m_dsp.adpcm_ref = m_dsp.data[m_dsp.d_rptr++];
m_dsp.adpcm_new_ref = false;
- m_dacl->write_unsigned8(m_dsp.adpcm_ref);
- m_dacr->write_unsigned8(m_dsp.adpcm_ref);
+ m_ldac->write(m_dsp.adpcm_ref << 8);
+ m_rdac->write(m_dsp.adpcm_ref << 8);
break;
}
lsample = m_dsp.data[m_dsp.d_rptr];
diff --git a/src/devices/bus/isa/sblaster.h b/src/devices/bus/isa/sblaster.h
index 4481193c6fe..47868b51579 100644
--- a/src/devices/bus/isa/sblaster.h
+++ b/src/devices/bus/isa/sblaster.h
@@ -99,8 +99,8 @@ public:
// construction/destruction
sb_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock, const char *name, const char *shortname, const char *source);
- required_device<dac_device> m_dacl;
- required_device<dac_device> m_dacr;
+ required_device<dac_16bit_r2r_device> m_ldac;
+ required_device<dac_16bit_r2r_device> m_rdac;
required_device<pc_joy_device> m_joy;
required_device<midi_port_device> m_mdout;
required_ioport m_config;
diff --git a/src/devices/bus/isa/stereo_fx.cpp b/src/devices/bus/isa/stereo_fx.cpp
index 6b76e6c730f..b3877e423a0 100644
--- a/src/devices/bus/isa/stereo_fx.cpp
+++ b/src/devices/bus/isa/stereo_fx.cpp
@@ -5,6 +5,8 @@
// TODO: UART is connected to MIDI port
#include "stereo_fx.h"
+#include "sound/dac.h"
+#include "sound/volt_reg.h"
const device_type ISA8_STEREO_FX = &device_creator<stereo_fx_device>;
@@ -89,13 +91,13 @@ ROM_END
static ADDRESS_MAP_START(stereo_fx_io, AS_IO, 8, stereo_fx_device)
AM_RANGE(0xFF00, 0xFF00) AM_WRITE(port00_w)
- AM_RANGE(0xFF10, 0xFF10) AM_DEVWRITE("dacr", dac_device, write_unsigned8)
+ AM_RANGE(0xFF10, 0xFF10) AM_DEVWRITE("rdac", dac_byte_interface, write)
AM_RANGE(0xFF20, 0xFF20) AM_WRITE(port20_w)
//AM_RANGE(0xFF30, 0xFF30) AM_WRITE() // used only on reset and undocumented cmd 0xc4
AM_RANGE(0xFF40, 0xFF40) AM_READWRITE(dev_dsp_data_r, dev_dsp_data_w)
AM_RANGE(0xFF50, 0xFF50) AM_WRITE(raise_drq_w)
AM_RANGE(0xFF60, 0xFF60) AM_WRITE(dev_host_irq_w)
- AM_RANGE(MCS51_PORT_P1, MCS51_PORT_P1) AM_READ(p1_r) AM_DEVWRITE("dacl", dac_device, write_unsigned8)
+ AM_RANGE(MCS51_PORT_P1, MCS51_PORT_P1) AM_READ(p1_r) AM_DEVWRITE("ldac", dac_byte_interface, write)
AM_RANGE(MCS51_PORT_P3, MCS51_PORT_P3) AM_READWRITE(p3_r, p3_w)
ADDRESS_MAP_END
@@ -114,10 +116,11 @@ static MACHINE_CONFIG_FRAGMENT( stereo_fx )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.00)
/* no CM/S support (empty sockets) */
- MCFG_SOUND_ADD("dacl", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.00)
- MCFG_SOUND_ADD("dacr", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.00)
+ MCFG_SOUND_ADD("ldac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.5) // unknown DAC
+ MCFG_SOUND_ADD("rdac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.5) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "ldac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "ldac", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "rdac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "rdac", -1.0, DAC_VREF_NEG_INPUT)
MCFG_PC_JOY_ADD("pc_joy")
MACHINE_CONFIG_END
@@ -189,8 +192,6 @@ READ8_MEMBER( stereo_fx_device::invalid_r )
stereo_fx_device::stereo_fx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
device_t(mconfig, ISA8_STEREO_FX, "ATI Stereo F/X Audio Adapter", tag, owner, clock, "stereo_fx", __FILE__),
device_isa8_card_interface(mconfig, *this),
- m_dacl(*this, "dacl"),
- m_dacr(*this, "dacr"),
m_joy(*this, "pc_joy"),
m_cpu(*this, "stereo_fx_cpu"), m_data_in(false), m_in_byte(0), m_data_out(false), m_out_byte(0), m_port20(0), m_port00(0), m_timer(nullptr), m_t0(0)
{
diff --git a/src/devices/bus/isa/stereo_fx.h b/src/devices/bus/isa/stereo_fx.h
index 68c0888440f..56ac6d1f74b 100644
--- a/src/devices/bus/isa/stereo_fx.h
+++ b/src/devices/bus/isa/stereo_fx.h
@@ -5,7 +5,6 @@
#include "emu.h"
#include "isa.h"
-#include "sound/dac.h"
#include "bus/pc_joy/pc_joy.h"
#include "cpu/mcs51/mcs51.h"
#include "sound/3812intf.h"
@@ -27,8 +26,6 @@ public:
virtual const tiny_rom_entry *device_rom_region() const override;
virtual machine_config_constructor device_mconfig_additions() const override;
- required_device<dac_device> m_dacl;
- required_device<dac_device> m_dacr;
required_device<pc_joy_device> m_joy;
required_device<cpu_device> m_cpu;
diff --git a/src/devices/bus/lpci/southbridge.h b/src/devices/bus/lpci/southbridge.h
index 5e280192dd4..d2591646d3e 100644
--- a/src/devices/bus/lpci/southbridge.h
+++ b/src/devices/bus/lpci/southbridge.h
@@ -18,7 +18,6 @@
#include "imagedev/harddriv.h"
#include "pci.h"
-#include "sound/dac.h"
#include "sound/speaker.h"
#include "machine/ram.h"
#include "machine/nvram.h"
diff --git a/src/devices/bus/msx_cart/konami.cpp b/src/devices/bus/msx_cart/konami.cpp
index ed0a7f8b3f9..659fdf054ea 100644
--- a/src/devices/bus/msx_cart/konami.cpp
+++ b/src/devices/bus/msx_cart/konami.cpp
@@ -2,6 +2,7 @@
// copyright-holders:Wilbert Pol
#include "emu.h"
#include "konami.h"
+#include "sound/volt_reg.h"
const device_type MSX_CART_KONAMI = &device_creator<msx_cart_konami>;
const device_type MSX_CART_KONAMI_SCC = &device_creator<msx_cart_konami_scc>;
@@ -476,9 +477,10 @@ msx_cart_synthesizer::msx_cart_synthesizer(const machine_config &mconfig, const
static MACHINE_CONFIG_FRAGMENT( synthesizer )
// This is actually incorrect. The sound output is passed back into the MSX machine where it is mixed internally and output through the system 'speaker'.
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("dac", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.1) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
@@ -518,7 +520,7 @@ WRITE8_MEMBER(msx_cart_synthesizer::write_cart)
{
if ((offset & 0xc010) == 0x4000)
{
- m_dac->write_unsigned8(data);
+ m_dac->write(data);
}
}
diff --git a/src/devices/bus/msx_cart/konami.h b/src/devices/bus/msx_cart/konami.h
index aecbc320f92..f42057692b6 100644
--- a/src/devices/bus/msx_cart/konami.h
+++ b/src/devices/bus/msx_cart/konami.h
@@ -112,7 +112,7 @@ public:
private:
UINT8 *m_bank_base;
- required_device<dac_device> m_dac;
+ required_device<dac_byte_interface> m_dac;
};
diff --git a/src/devices/bus/msx_cart/majutsushi.cpp b/src/devices/bus/msx_cart/majutsushi.cpp
index 23091c1fb4b..49dc7b25450 100644
--- a/src/devices/bus/msx_cart/majutsushi.cpp
+++ b/src/devices/bus/msx_cart/majutsushi.cpp
@@ -2,6 +2,7 @@
// copyright-holders:Wilbert Pol
#include "emu.h"
#include "majutsushi.h"
+#include "sound/volt_reg.h"
const device_type MSX_CART_MAJUTSUSHI = &device_creator<msx_cart_majutsushi>;
@@ -24,9 +25,10 @@ msx_cart_majutsushi::msx_cart_majutsushi(const machine_config &mconfig, const ch
static MACHINE_CONFIG_FRAGMENT( majutsushi )
// This is actually incorrect. The sound output is passed back into the MSX machine where it is mixed internally and output through the system 'speaker'.
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("dac", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.05) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
@@ -90,7 +92,7 @@ WRITE8_MEMBER(msx_cart_majutsushi::write_cart)
case 0x4000:
if (offset & 0x1000)
{
- m_dac->write_unsigned8(data);
+ m_dac->write(data);
}
break;
diff --git a/src/devices/bus/msx_cart/majutsushi.h b/src/devices/bus/msx_cart/majutsushi.h
index 2cff08446a2..82a454b785c 100644
--- a/src/devices/bus/msx_cart/majutsushi.h
+++ b/src/devices/bus/msx_cart/majutsushi.h
@@ -29,7 +29,7 @@ public:
void restore_banks();
private:
- required_device<dac_device> m_dac;
+ required_device<dac_byte_interface> m_dac;
UINT8 m_selected_bank[4];
UINT8 *m_bank_base[8];
diff --git a/src/devices/bus/pet/2joysnd.cpp b/src/devices/bus/pet/2joysnd.cpp
index ef8fb7f974c..41e998ca429 100644
--- a/src/devices/bus/pet/2joysnd.cpp
+++ b/src/devices/bus/pet/2joysnd.cpp
@@ -47,6 +47,7 @@ Connections
*/
#include "2joysnd.h"
+#include "sound/volt_reg.h"
//**************************************************************************
@@ -55,12 +56,11 @@ Connections
const device_type PET_USERPORT_JOYSTICK_AND_SOUND_DEVICE = &device_creator<pet_userport_joystick_and_sound_device>;
-#define DAC_TAG "dac"
-
MACHINE_CONFIG_FRAGMENT( 2joysnd )
- MCFG_SPEAKER_STANDARD_MONO("cb2spkr")
- MCFG_SOUND_ADD(DAC_TAG, DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "cb2spkr", 1.00)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.99)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT)
MACHINE_CONFIG_END
//-------------------------------------------------
@@ -113,7 +113,7 @@ machine_config_constructor pet_userport_joystick_and_sound_device::device_mconfi
pet_userport_joystick_and_sound_device::pet_userport_joystick_and_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
device_t(mconfig, PET_USERPORT_JOYSTICK_AND_SOUND_DEVICE, "Dual Joysticks and Sound", tag, owner, clock, "2joysnd", __FILE__),
device_pet_user_port_interface(mconfig, *this),
- m_dac(*this, DAC_TAG),
+ m_dac(*this, "dac"),
m_up1(1),
m_down1(1),
m_fire1(1),
@@ -158,5 +158,5 @@ void pet_userport_joystick_and_sound_device::update_port2()
DECLARE_WRITE_LINE_MEMBER( pet_userport_joystick_and_sound_device::input_m )
{
- m_dac->write_unsigned8(state ? 0xff : 0x00);
+ m_dac->write(state);
}
diff --git a/src/devices/bus/pet/2joysnd.h b/src/devices/bus/pet/2joysnd.h
index ee2232e6ad3..040e867ef99 100644
--- a/src/devices/bus/pet/2joysnd.h
+++ b/src/devices/bus/pet/2joysnd.h
@@ -37,7 +37,7 @@ public:
virtual DECLARE_WRITE_LINE_MEMBER( input_m ) override;
- required_device<dac_device> m_dac;
+ required_device<dac_bit_interface> m_dac;
// device_pet_user_port_interface overrides
WRITE_LINE_MEMBER( write_up1 ) { m_up1 = state; update_port1(); }
diff --git a/src/devices/bus/pet/cb2snd.cpp b/src/devices/bus/pet/cb2snd.cpp
index d89ef26268c..b2ef21f79b1 100644
--- a/src/devices/bus/pet/cb2snd.cpp
+++ b/src/devices/bus/pet/cb2snd.cpp
@@ -9,6 +9,7 @@
**********************************************************************/
#include "cb2snd.h"
+#include "sound/volt_reg.h"
//**************************************************************************
// DEVICE DEFINITIONS
@@ -16,12 +17,11 @@
const device_type PET_USERPORT_CB2_SOUND_DEVICE = &device_creator<pet_userport_cb2_sound_device>;
-#define DAC_TAG "dac"
-
MACHINE_CONFIG_FRAGMENT( cb2snd )
- MCFG_SPEAKER_STANDARD_MONO("cb2spkr")
- MCFG_SOUND_ADD(DAC_TAG, DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "cb2spkr", 1.00)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.99)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT)
MACHINE_CONFIG_END
//-------------------------------------------------
@@ -45,7 +45,7 @@ machine_config_constructor pet_userport_cb2_sound_device::device_mconfig_additio
pet_userport_cb2_sound_device::pet_userport_cb2_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
device_t(mconfig, PET_USERPORT_CB2_SOUND_DEVICE, "PET Userport 'CB2 Sound' Device", tag, owner, clock, "petucb2", __FILE__),
device_pet_user_port_interface(mconfig, *this),
- m_dac(*this, DAC_TAG)
+ m_dac(*this, "dac")
{
}
@@ -60,5 +60,5 @@ void pet_userport_cb2_sound_device::device_start()
DECLARE_WRITE_LINE_MEMBER( pet_userport_cb2_sound_device::input_m )
{
- m_dac->write_unsigned8(state ? 0xff : 0x00);
+ m_dac->write(state);
}
diff --git a/src/devices/bus/pet/cb2snd.h b/src/devices/bus/pet/cb2snd.h
index 8f62c8973bf..e8caed04480 100644
--- a/src/devices/bus/pet/cb2snd.h
+++ b/src/devices/bus/pet/cb2snd.h
@@ -30,7 +30,7 @@ public:
virtual DECLARE_WRITE_LINE_MEMBER( input_m ) override;
- required_device<dac_device> m_dac;
+ required_device<dac_bit_interface> m_dac;
protected:
// device-level overrides
diff --git a/src/devices/bus/plus4/sid.cpp b/src/devices/bus/plus4/sid.cpp
index 4c100861cd6..d5b72e2a0ea 100644
--- a/src/devices/bus/plus4/sid.cpp
+++ b/src/devices/bus/plus4/sid.cpp
@@ -62,11 +62,9 @@ const tiny_rom_entry *plus4_sid_cartridge_device::device_rom_region() const
//-------------------------------------------------
static MACHINE_CONFIG_FRAGMENT( plus4_sid )
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_SOUND_ADD(MOS8580_TAG, MOS8580, XTAL_17_73447MHz/20)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
- MCFG_SOUND_ADD("dac", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, nullptr)
MACHINE_CONFIG_END
diff --git a/src/devices/bus/plus4/sid.h b/src/devices/bus/plus4/sid.h
index b5980849425..2c9f59c98f2 100644
--- a/src/devices/bus/plus4/sid.h
+++ b/src/devices/bus/plus4/sid.h
@@ -14,7 +14,6 @@
#include "emu.h"
#include "exp.h"
#include "bus/vcs_ctrl/ctrl.h"
-#include "sound/dac.h"
#include "sound/mos6581.h"
diff --git a/src/devices/machine/mc6846.cpp b/src/devices/machine/mc6846.cpp
index 18b9f723bfb..5958ba87f9b 100644
--- a/src/devices/machine/mc6846.cpp
+++ b/src/devices/machine/mc6846.cpp
@@ -178,7 +178,7 @@ inline void mc6846_device::update_cto()
m_old_cto = cto;
}
if ( !m_out_cto_cb.isnull() )
- m_out_cto_cb( (offs_t) 0, cto );
+ m_out_cto_cb( cto );
}
@@ -396,7 +396,7 @@ WRITE8_MEMBER(mc6846_device::write)
{
m_cp2_cpu = (data >> 3) & 1;
if ( !m_out_cp2_cb.isnull() )
- m_out_cp2_cb( (offs_t) 0, m_cp2_cpu );
+ m_out_cp2_cb( m_cp2_cpu );
}
else
logerror( "%s mc6846 acknowledge not implemented\n", machine().describe_context() );
diff --git a/src/devices/machine/mc6846.h b/src/devices/machine/mc6846.h
index bb198ee64d7..b174000b739 100644
--- a/src/devices/machine/mc6846.h
+++ b/src/devices/machine/mc6846.h
@@ -96,14 +96,14 @@ private:
/* CPU write to the outside through chip */
devcb_write8 m_out_port_cb; /* 8-bit output */
- devcb_write8 m_out_cp1_cb; /* 1-bit output */
- devcb_write8 m_out_cp2_cb; /* 1-bit output */
+ devcb_write_line m_out_cp1_cb; /* 1-bit output */
+ devcb_write_line m_out_cp2_cb; /* 1-bit output */
/* CPU read from the outside through chip */
devcb_read8 m_in_port_cb; /* 8-bit input */
/* asynchronous timer output to outside world */
- devcb_write8 m_out_cto_cb; /* 1-bit output */
+ devcb_write_line m_out_cto_cb; /* 1-bit output */
/* timer interrupt */
devcb_write_line m_irq_cb;
diff --git a/src/devices/machine/s3c2400.cpp b/src/devices/machine/s3c2400.cpp
index 157e13bbf85..8b9d4da016c 100644
--- a/src/devices/machine/s3c2400.cpp
+++ b/src/devices/machine/s3c2400.cpp
@@ -12,7 +12,6 @@
#include "cpu/arm7/arm7.h"
#include "cpu/arm7/arm7core.h"
#include "machine/s3c2400.h"
-#include "sound/dac.h"
#define VERBOSE_LEVEL ( 0 )
diff --git a/src/devices/machine/s3c2410.cpp b/src/devices/machine/s3c2410.cpp
index 24d6664dea3..c036b1f362c 100644
--- a/src/devices/machine/s3c2410.cpp
+++ b/src/devices/machine/s3c2410.cpp
@@ -12,7 +12,6 @@
#include "cpu/arm7/arm7.h"
#include "cpu/arm7/arm7core.h"
#include "machine/s3c2410.h"
-#include "sound/dac.h"
#define VERBOSE_LEVEL ( 0 )
diff --git a/src/devices/machine/s3c2440.cpp b/src/devices/machine/s3c2440.cpp
index fece3da05ab..9ad23516c8d 100644
--- a/src/devices/machine/s3c2440.cpp
+++ b/src/devices/machine/s3c2440.cpp
@@ -12,7 +12,6 @@
#include "cpu/arm7/arm7.h"
#include "cpu/arm7/arm7core.h"
#include "machine/s3c2440.h"
-#include "sound/dac.h"
#define VERBOSE_LEVEL ( 0 )
diff --git a/src/devices/machine/s3c44b0.cpp b/src/devices/machine/s3c44b0.cpp
index bf81606cf12..7660918e1a5 100644
--- a/src/devices/machine/s3c44b0.cpp
+++ b/src/devices/machine/s3c44b0.cpp
@@ -12,7 +12,6 @@
#include "cpu/arm7/arm7.h"
#include "cpu/arm7/arm7core.h"
#include "machine/s3c44b0.h"
-#include "sound/dac.h"
#include "coreutil.h"
#define VERBOSE_LEVEL ( 0 )
diff --git a/src/devices/sound/ad1848.cpp b/src/devices/sound/ad1848.cpp
index 4c299be37be..cb2607362c1 100644
--- a/src/devices/sound/ad1848.cpp
+++ b/src/devices/sound/ad1848.cpp
@@ -4,6 +4,7 @@
// Analog Devices AD1848, main codec in Windows Sound System adapters
#include "sound/ad1848.h"
+#include "sound/volt_reg.h"
const device_type AD1848 = device_creator<ad1848_device>;
@@ -11,17 +12,18 @@ ad1848_device::ad1848_device(const machine_config &mconfig, const char *tag, dev
device_t(mconfig, AD1848, "Analog Devices AD1848", tag, owner, clock, "ad1848", __FILE__),
m_irq_cb(*this),
m_drq_cb(*this),
- m_dacl(*this, "dacl"),
- m_dacr(*this, "dacr")
+ m_ldac(*this, "ldac"),
+ m_rdac(*this, "rdac")
{
}
static MACHINE_CONFIG_FRAGMENT( ad1848_config )
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
- MCFG_SOUND_ADD("dacl", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.00)
- MCFG_SOUND_ADD("dacr", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.00)
+ MCFG_SOUND_ADD("ldac", DAC_16BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.5) // unknown DAC
+ MCFG_SOUND_ADD("rdac", DAC_16BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.5) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "ldac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "ldac", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "rdac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "rdac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
machine_config_constructor ad1848_device::device_mconfig_additions() const
@@ -149,12 +151,12 @@ void ad1848_device::device_timer(emu_timer &timer, device_timer_id id, int param
switch(m_regs.dform >> 4)
{
case 0: // 8bit mono
- m_dacl->write_unsigned8(m_samples & 0xff);
- m_dacr->write_unsigned8(m_samples & 0xff);
+ m_ldac->write(m_samples << 8);
+ m_rdac->write(m_samples << 8);
break;
case 1: // 8bit stereo
- m_dacl->write_unsigned8(m_samples & 0xff);
- m_dacr->write_unsigned8((m_samples >> 8) & 0xff);
+ m_ldac->write(m_samples << 8);
+ m_rdac->write(m_samples & 0xff00);
break;
case 2: // ulaw mono
case 3: // ulaw stereo
@@ -162,12 +164,12 @@ void ad1848_device::device_timer(emu_timer &timer, device_timer_id id, int param
case 7: // alaw stereo
break;
case 4: // 16bit mono
- m_dacl->write(m_samples & 0xffff);
- m_dacr->write(m_samples & 0xffff);
+ m_ldac->write(m_samples ^ 0x8000);
+ m_rdac->write(m_samples ^ 0x8000);
break;
case 5: // 16bit stereo
- m_dacl->write(m_samples & 0xffff);
- m_dacr->write(m_samples >> 16);
+ m_ldac->write(m_samples ^ 0x8000);
+ m_rdac->write((m_samples >> 16) ^ 0x8000);
break;
}
if(!m_count)
diff --git a/src/devices/sound/ad1848.h b/src/devices/sound/ad1848.h
index d2c93c57329..161172f9749 100644
--- a/src/devices/sound/ad1848.h
+++ b/src/devices/sound/ad1848.h
@@ -57,8 +57,8 @@ private:
bool m_play, m_mce, m_trd;
devcb_write_line m_irq_cb;
devcb_write_line m_drq_cb;
- required_device<dac_device> m_dacl;
- required_device<dac_device> m_dacr;
+ required_device<dac_word_interface> m_ldac;
+ required_device<dac_word_interface> m_rdac;
emu_timer *m_timer;
};
diff --git a/src/devices/sound/dac.cpp b/src/devices/sound/dac.cpp
index d51b51c1410..8650e1decb7 100644
--- a/src/devices/sound/dac.cpp
+++ b/src/devices/sound/dac.cpp
@@ -1,92 +1,18 @@
// license:BSD-3-Clause
-// copyright-holders:Aaron Giles
+// copyright-holders:smf
/***************************************************************************
- dac.c
+ dac.cpp
- DAC device emulator.
+ Four quadrant multiplying DAC.
-***************************************************************************/
-
-#include "emu.h"
-#include "dac.h"
-
-
-// device type definition
-const device_type DAC = &device_creator<dac_device>;
-
-
-//**************************************************************************
-// LIVE DEVICE
-//**************************************************************************
-
-//-------------------------------------------------
-// dac_device - constructor
-//-------------------------------------------------
-
-dac_device::dac_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : device_t(mconfig, DAC, "DAC", tag, owner, clock, "dac", __FILE__),
- device_sound_interface(mconfig, *this),
- m_stream(nullptr),
- m_output(0)
-{
-}
-
-
-//-------------------------------------------------
-// write_unsigned8 - write an 8-bit value,
-// keeping the scaled result unsigned
-//-------------------------------------------------
-
-WRITE8_MEMBER( dac_device::write_unsigned8 )
-{
- write_unsigned8(data);
-}
+ Binary Weighted Resistor Network, R-2R Ladder & PWM
+ Binary, Ones Complement, Twos Complement or Sign Magnitude coding
-//-------------------------------------------------
-// write_signed8 - write an 8-bit value,
-// keeping the scaled result signed
-//-------------------------------------------------
-
-WRITE8_MEMBER( dac_device::write_signed8 )
-{
- write_signed8(data);
-}
-
-
-//-------------------------------------------------
-// device_start - device-specific startup
-//-------------------------------------------------
-
-void dac_device::device_start()
-{
- // create the stream
- m_stream = stream_alloc(0, 1, DEFAULT_SAMPLE_RATE);
-
- // register for save states
- save_item(NAME(m_output));
-}
-
-
-//-------------------------------------------------
-// device_reset - device-specific reset
-//-------------------------------------------------
-
-void dac_device::device_reset()
-{
- m_output = 0;
-}
-
+***************************************************************************/
-//-------------------------------------------------
-// sound_stream_update - handle update requests
-// for our sound stream
-//-------------------------------------------------
+#define DAC_GENERATOR_EPILOG(_dac_type, _dac_class) \
+const device_type _dac_type = &device_creator<_dac_class>;
-void dac_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
-{
- // just fill with current value
- for (int samp = 0; samp < samples; samp++)
- outputs[0][samp] = m_output;
-}
+#include "dac.h"
diff --git a/src/devices/sound/dac.h b/src/devices/sound/dac.h
index bd5bdf16d62..c3983eee492 100644
--- a/src/devices/sound/dac.h
+++ b/src/devices/sound/dac.h
@@ -1,70 +1,319 @@
// license:BSD-3-Clause
-// copyright-holders:Aaron Giles
+// copyright-holders:smf
/***************************************************************************
dac.h
- DAC device emulator.
+ Four quadrant multiplying DAC.
+
+ Binary Weighted Resistor Network, R-2R Ladder & PWM
+
+ Binary, Ones Complement, Twos Complement or Sign Magnitude coding
***************************************************************************/
#ifndef __DAC_H__
#define __DAC_H__
+#include "emu.h"
-//**************************************************************************
-// INTERFACE CONFIGURATION MACROS
-//**************************************************************************
+#define DAC_VREF_POS_INPUT (0)
+#define DAC_VREF_NEG_INPUT (1)
-#define MCFG_DAC_ADD(_tag) \
- MCFG_DEVICE_ADD(_tag, DAC, 0)
+class dac_bit_interface
+{
+public:
+ virtual DECLARE_WRITE_LINE_MEMBER(write) = 0;
+ virtual DECLARE_WRITE8_MEMBER(write) = 0;
+};
+class dac_byte_interface
+{
+public:
+ virtual void write(unsigned char data) = 0;
+ virtual DECLARE_WRITE8_MEMBER(write) = 0;
+};
-//**************************************************************************
-// TYPE DEFINITIONS
-//**************************************************************************
+class dac_word_interface
+{
+public:
+ virtual void write(unsigned short data) = 0;
+ virtual DECLARE_WRITE16_MEMBER(write) = 0;
+};
+template <int bits>
+stream_sample_t dac_multiply(const double vref, const stream_sample_t code)
+{
+ if (bits > 1)
+ return (vref * code) / (1 << (bits));
-// ======================> dac_device
+ return vref * code;
+}
+
+template <int bits>
+class dac_code
+{
+protected:
+ dac_code(double gain) :
+ m_stream(nullptr),
+ m_code(0),
+ m_gain(gain)
+ {
+ }
+
+ sound_stream * m_stream;
+ stream_sample_t m_code;
+ const double m_gain;
+
+ inline void setCode(stream_sample_t code)
+ {
+ code &= ~(~0U << bits);
+ if (m_code != code)
+ {
+ m_stream->update();
+ m_code = code;
+ }
+ }
+
+ virtual void sound_stream_update_tag(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) = 0;
+};
+
+template <int bits>
+class dac_code_binary :
+ protected dac_code<bits>
+{
+protected:
+ dac_code_binary(double gain) :
+ dac_code<bits>(gain)
+ {
+ }
+
+ virtual void sound_stream_update_tag(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override
+ {
+ for (int samp = 0; samp < samples; samp++)
+ {
+ double vref_pos = inputs[DAC_VREF_POS_INPUT][samp] * this->m_gain;
+ double vref_neg = inputs[DAC_VREF_NEG_INPUT][samp] * this->m_gain;
+ stream_sample_t vout = vref_neg + dac_multiply<bits>(vref_pos - vref_neg, this->m_code);
+ outputs[0][samp] = vout;
+ }
+ }
+};
+
+template <int bits>
+class dac_code_ones_complement :
+ protected dac_code<bits>
+{
+protected:
+ dac_code_ones_complement(double gain) : dac_code<bits>(gain) {}
+
+ virtual void sound_stream_update_tag(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override
+ {
+ if (this->m_code & (1 << (bits - 1)))
+ {
+ for (int samp = 0; samp < samples; samp++)
+ {
+ double vref_neg = inputs[DAC_VREF_NEG_INPUT][samp] * this->m_gain;
+ stream_sample_t vout = dac_multiply<bits - 1>(vref_neg, this->m_code ^ ~(~0U << bits));
+ outputs[0][samp] = vout;
+ }
+ }
+ else
+ {
+ for (int samp = 0; samp < samples; samp++)
+ {
+ double vref_pos = inputs[DAC_VREF_POS_INPUT][samp] * this->m_gain;
+ stream_sample_t vout = dac_multiply<bits - 1>(vref_pos, this->m_code);
+ outputs[0][samp] = vout;
+ }
+ }
+ }
+};
+template <int bits>
+class dac_code_twos_complement :
+ protected dac_code<bits>
+{
+protected:
+ dac_code_twos_complement(double gain) :
+ dac_code<bits>(gain)
+ {
+ }
+
+ virtual void sound_stream_update_tag(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override
+ {
+ for (int samp = 0; samp < samples; samp++)
+ {
+ double vref_pos = inputs[DAC_VREF_POS_INPUT][samp] * this->m_gain;
+ double vref_neg = inputs[DAC_VREF_NEG_INPUT][samp] * this->m_gain;
+ stream_sample_t vout = vref_neg + dac_multiply<bits>(vref_pos - vref_neg, this->m_code ^ (1 << (bits - 1)));
+ outputs[0][samp] = vout;
+ }
+ }
+};
+
+template <int bits>
+class dac_code_sign_magntitude :
+ protected dac_code<bits>
+{
+protected:
+ dac_code_sign_magntitude(double gain) :
+ dac_code<bits>(gain)
+ {
+ }
+
+ virtual void sound_stream_update_tag(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override
+ {
+ if (this->m_code & (1 << (bits - 1)))
+ {
+ for (int samp = 0; samp < samples; samp++)
+ {
+ double vref_neg = inputs[DAC_VREF_NEG_INPUT][samp] * this->m_gain;
+ stream_sample_t vout = dac_multiply<bits - 1>(vref_neg, this->m_code ^ (1 << (bits - 1)));
+ outputs[0][samp] = vout;
+ }
+ }
+ else
+ {
+ for (int samp = 0; samp < samples; samp++)
+ {
+ double vref_pos = inputs[DAC_VREF_POS_INPUT][samp] * this->m_gain;
+ stream_sample_t vout = dac_multiply<bits - 1>(vref_pos, this->m_code);
+ outputs[0][samp] = vout;
+ }
+ }
+ }
+};
+
+
+template <typename _dac_code>
class dac_device : public device_t,
- public device_sound_interface
+ public device_sound_interface,
+ protected _dac_code
{
- // default to 4x oversampling
- static const UINT32 DEFAULT_SAMPLE_RATE = 48000 * 4;
+protected:
+ dac_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source, double gain)
+ : device_t(mconfig, type, name, tag, owner, clock, shortname, source),
+ device_sound_interface(mconfig, *this),
+ _dac_code(gain)
+ {
+ }
+
+ virtual void device_start() override
+ {
+ this->m_stream = stream_alloc(2, 1, 48000 * 4);
+
+ save_item(NAME(this->m_code));
+ }
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override
+ {
+ _dac_code::sound_stream_update_tag(stream, inputs, outputs, samples);
+ }
+};
+
+template <typename dac_interface, typename _dac_code> class dac_generator;
+
+template <typename _dac_code>
+class dac_generator<dac_bit_interface, _dac_code> :
+ public dac_bit_interface,
+ public dac_device<_dac_code>
+{
public:
- // construction/destruction
- dac_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ dac_generator(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source, double gain) :
+ dac_device<_dac_code>(mconfig, type, name, tag, owner, clock, shortname, source, gain)
+ {
+ }
- // public interface
- INT16 output() const { return m_output; }
- void write(INT16 data) { m_stream->update(); m_output = data; }
- void write_unsigned8(UINT8 data) { write(data * 32767 / 255); } // 0..255, mapped to 0..32767
- void write_signed8(UINT8 data) { write((data - 0x80) * 32767 / 128); } // 0..255, mapped to -32767..32767
- void write_unsigned16(UINT16 data) { write(data / 2); } // 0..65535, mapped to 0..32767
- void write_signed16(UINT16 data) { write(data - 0x8000); } // 0..65535, mapped to -32768..32767
+ virtual WRITE_LINE_MEMBER(write) override { this->setCode(state); }
+ virtual WRITE8_MEMBER(write) override { this->setCode(data); }
+};
- // wrappers
- DECLARE_WRITE8_MEMBER( write_unsigned8 );
- DECLARE_WRITE8_MEMBER( write_signed8 );
+template <typename _dac_code>
+class dac_generator<dac_byte_interface, _dac_code> :
+ public dac_byte_interface,
+ public dac_device<_dac_code>
+{
+public:
+ dac_generator(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source, double gain) :
+ dac_device<_dac_code>(mconfig, type, name, tag, owner, clock, shortname, source, gain)
+ {
+ }
-protected:
- // device-level overrides
- virtual void device_start() override;
- virtual void device_reset() override;
+ virtual void write(unsigned char data) override { this->setCode(data); }
+ virtual DECLARE_WRITE8_MEMBER(write) override { this->setCode(data); }
+};
- // device_sound_interface overrides
- virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override;
+template <typename _dac_code>
+class dac_generator<dac_word_interface, _dac_code> :
+ public dac_word_interface,
+ public dac_device<_dac_code>
+{
+public:
+ dac_generator(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source, double gain) :
+ dac_device<_dac_code>(mconfig, type, name, tag, owner, clock, shortname, source, gain)
+ {
+ }
- // internal state
- sound_stream * m_stream;
- INT16 m_output;
+ virtual void write(unsigned short data) override { this->setCode(data); }
+ virtual DECLARE_WRITE16_MEMBER(write) override { this->setCode(data); }
};
+const double dac_gain_r2r = 1.0;
+const double dac_gain_binary_weighted = 2.0;
+
+#ifndef DAC_GENERATOR_EPILOG
+#define DAC_GENERATOR_EPILOG(_dac_type, _dac_class) //
+#endif
+
+#define DAC_GENERATOR(_dac_type, _dac_class, _dac_interface, _dac_coding, _dac_gain, _dac_description, _dac_shortname) \
+extern const device_type _dac_type; \
+class _dac_class : public dac_generator<_dac_interface, _dac_coding> \
+{\
+public: \
+ _dac_class(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : \
+ dac_generator(mconfig, _dac_type, _dac_description, tag, owner, clock, _dac_shortname, __FILE__, _dac_gain) {} \
+}; \
+DAC_GENERATOR_EPILOG(_dac_type, _dac_class)
+
+// DAC chips
+DAC_GENERATOR(AD7521, ad7521_device, dac_word_interface, dac_code_binary<12>, dac_gain_r2r, "AD7521", "ad7521")
+DAC_GENERATOR(AD7524, ad7524_device, dac_byte_interface, dac_code_binary<8>, dac_gain_r2r, "AD7524", "ad7524")
+DAC_GENERATOR(AD7528, ad7528_device, dac_byte_interface, dac_code_binary<8>, dac_gain_r2r, "AD7528", "ad7528") /// 2 x vin + 2 x vout
+DAC_GENERATOR(AD7533, ad7533_device, dac_word_interface, dac_code_binary<10>, dac_gain_r2r, "AD7533", "ad7533")
+DAC_GENERATOR(AD7541, ad7541_device, dac_word_interface, dac_code_binary<12>, dac_gain_r2r, "AD7541", "ad7541")
+DAC_GENERATOR(AM6012, am6012_device, dac_word_interface, dac_code_binary<12>, dac_gain_r2r, "AM6012", "am6012")
+DAC_GENERATOR(DAC0800, dac0800_device, dac_byte_interface, dac_code_binary<8>, dac_gain_r2r, "DAC0800", "dac0800")
+DAC_GENERATOR(DAC1200, dac1200_device, dac_word_interface, dac_code_binary<12>, dac_gain_r2r, "DAC1200", "dac1200")
+DAC_GENERATOR(MC1408, mc1408_device, dac_byte_interface, dac_code_binary<8>, dac_gain_r2r, "MC1408", "mc1408")
+DAC_GENERATOR(MC3408, mc3408_device, dac_byte_interface, dac_code_binary<8>, dac_gain_r2r, "MC3408", "mc3408")
+DAC_GENERATOR(MC3410, mc3410_device, dac_word_interface, dac_code_binary<10>, dac_gain_r2r, "MC3410", "mc3410")
+DAC_GENERATOR(PCM54HP, pcm54hp_device, dac_word_interface, dac_code_binary<16>, dac_gain_r2r, "PCM54HP", "pcm54hp")
+DAC_GENERATOR(UDA1341TS, uda1341ts_device, dac_word_interface, dac_code_twos_complement<16>, dac_gain_r2r, "UDA1341TS", "uda1341ts") // I2C stereo audio codec
+DAC_GENERATOR(ZN425E, zn425e_device, dac_byte_interface, dac_code_binary<8>, dac_gain_r2r, "ZN425E", "zn425e")
-// device type definition
-extern const device_type DAC;
+// DAC circuits/unidentified chips
+DAC_GENERATOR(DAC_1BIT, dac_1bit_device, dac_bit_interface, dac_code_binary<1>, 1.0, "1-Bit DAC", "dac")
+DAC_GENERATOR(DAC_2BIT_BINARY_WEIGHTED, dac_2bit_binary_weighted_device, dac_byte_interface, dac_code_binary<2>, dac_gain_binary_weighted, "2-Bit Binary Weighted DAC", "dac_2bit_bw")
+DAC_GENERATOR(DAC_2BIT_BINARY_WEIGHTED_ONES_COMPLEMENT, dac_2bit_binary_weighted_ones_complement_device, dac_byte_interface, dac_code_ones_complement<2>, dac_gain_binary_weighted, "2-Bit Binary Weighted Ones Complement DAC", "dac_2bit_bw_oc")
+DAC_GENERATOR(DAC_2BIT_R2R, dac_2bit_r2r_device, dac_byte_interface, dac_code_binary<2>, dac_gain_r2r, "2-Bit R-2R DAC", "dac_2bit_r2r")
+DAC_GENERATOR(DAC_3BIT_BINARY_WEIGHTED, dac_3bit_binary_weighted_device, dac_byte_interface, dac_code_binary<3>, dac_gain_binary_weighted, "3-Bit Binary Weighted DAC", "dac_3bit_bw")
+DAC_GENERATOR(DAC_4BIT_BINARY_WEIGHTED, dac_4bit_binary_weighted_device, dac_byte_interface, dac_code_binary<4>, dac_gain_binary_weighted, "4-Bit Binary Weighted DAC", "dac_4bit_bw")
+DAC_GENERATOR(DAC_4BIT_BINARY_WEIGHTED_SIGN_MAGNITUDE, dac_4bit_binary_weighted_sign_magnitude_device, dac_byte_interface, dac_code_sign_magntitude<4>, dac_gain_binary_weighted, "4-Bit Binary Weighted Sign Magnitude DAC", "dac_4bit_bw_sm")
+DAC_GENERATOR(DAC_4BIT_R2R, dac_4bit_r2r_device, dac_byte_interface, dac_code_binary<4>, dac_gain_r2r, "4-Bit R-2R DAC", "dac_4bit_r2r")
+DAC_GENERATOR(DAC_6BIT_BINARY_WEIGHTED, dac_6bit_binary_weighted_device, dac_byte_interface, dac_code_binary<6>, dac_gain_binary_weighted, "6-Bit Binary Weighted DAC", "dac_6bit_bw")
+DAC_GENERATOR(DAC_6BIT_R2R, dac_6bit_r2r_device, dac_byte_interface, dac_code_binary<6>, dac_gain_r2r, "6-Bit R-2R DAC", "dac_6bit_r2r")
+DAC_GENERATOR(DAC_8BIT_BINARY_WEIGHTED, dac_binary_weighted_8bit_device, dac_byte_interface, dac_code_binary<8>, dac_gain_binary_weighted, "8-Bit Binary Weighted DAC", "dac_8bit_bw")
+DAC_GENERATOR(DAC_8BIT_PWM, dac_8bit_pwm_device, dac_byte_interface, dac_code_binary<8>, dac_gain_r2r, "8-Bit PWM DAC", "dac_8bit_pwm")
+DAC_GENERATOR(DAC_8BIT_R2R, dac_8bit_r2r_device, dac_byte_interface, dac_code_binary<8>, dac_gain_r2r, "8-Bit R-2R DAC", "dac_8bit_r2r")
+DAC_GENERATOR(DAC_8BIT_R2R_TWOS_COMPLEMENT, dac_8bit_r2r_twos_complement_device, dac_byte_interface, dac_code_twos_complement<8>, dac_gain_r2r, "8-Bit R-2R Twos Complement DAC", "dac_8bit_r2r_tc")
+DAC_GENERATOR(DAC_10BIT_R2R, dac_10bit_r2r_device, dac_word_interface, dac_code_binary<10>, dac_gain_r2r, "10-Bit R-2R DAC", "dac_10bit_r2r")
+DAC_GENERATOR(DAC_12BIT_R2R, dac_12bit_r2r_device, dac_word_interface, dac_code_binary<12>, dac_gain_r2r, "12-Bit R-2R DAC", "dac_12bit_r2r")
+DAC_GENERATOR(DAC_12BIT_R2R_TWOS_COMPLEMENT, dac_12bit_r2r_twos_complement_device, dac_word_interface, dac_code_twos_complement<12>, dac_gain_r2r, "12-Bit R-2R Twos Complement DAC", "dac_12bit_r2r_tc")
+DAC_GENERATOR(DAC_16BIT_R2R, dac_16bit_r2r_device, dac_word_interface, dac_code_binary<16>, dac_gain_r2r, "16-Bit R-2R DAC", "dac_16bit_r2r")
+DAC_GENERATOR(DAC_16BIT_R2R_TWOS_COMPLEMENT, dac_16bit_r2r_twos_complement_device, dac_word_interface, dac_code_twos_complement<16>, dac_gain_r2r, "16-Bit R-2R Twos Complement DAC", "dac_16bit_r2r_tc")
+#undef DAC_GENERATOR
+#undef DAC_GENERATOR_EPILOG
#endif /* __DAC_H__ */
diff --git a/src/mame/audio/mea8000.cpp b/src/devices/sound/mea8000.cpp
index a96098a83ce..481561a7fcf 100644
--- a/src/mame/audio/mea8000.cpp
+++ b/src/devices/sound/mea8000.cpp
@@ -45,7 +45,7 @@
#define LOG(x) do { if (VERBOSE) logerror x; } while (0)
/* digital filters work at 8 kHz */
-#define F0 8096
+#define F0 (clock() / 480)
/* filtered output is supersampled x 8 */
#define SUPERSAMPLING 8
@@ -115,9 +115,11 @@ const device_type MEA8000 = &device_creator<mea8000_device>;
mea8000_device::mea8000_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : device_t(mconfig, MEA8000, "Philips / Signetics MEA 8000 speech synthesizer", tag, owner, clock, "mea8000", __FILE__)
- , m_write_req(*this)
- , m_dac(*this, finder_base::DUMMY_TAG)
+ : device_t(mconfig, MEA8000, "Philips / Signetics MEA 8000 speech synthesizer", tag, owner, clock, "mea8000", __FILE__),
+ device_sound_interface(mconfig, *this),
+ m_write_req(*this),
+ m_stream(nullptr),
+ m_output(0)
{
}
@@ -132,6 +134,9 @@ void mea8000_device::device_start()
init_tables();
+ m_stream = stream_alloc(0, 1, clock() / 60);
+ save_item(NAME(m_output));
+
m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mea8000_device::timer_expire),this));
save_item(NAME(m_state));
@@ -161,26 +166,6 @@ void mea8000_device::device_start()
save_item(NAME(m_noise));
}
-//-------------------------------------------------
-// device_reset - device-specific reset
-//-------------------------------------------------
-
-void mea8000_device::device_reset()
-{
- LOG(("mea8000_reset\n"));
- m_timer->reset();
- m_phi = 0;
- m_cont = 0;
- m_roe = 0;
- m_state = MEA8000_STOPPED;
- update_req();
- for (auto & elem : m_f)
- {
- elem.last_output = 0;
- elem.output = 0;
- }
-}
-
/***************************** REQ **********************************/
@@ -431,11 +416,20 @@ void mea8000_device::stop_frame()
/* enter stop mode */
m_timer->reset();
m_state = MEA8000_STOPPED;
- m_dac->write_signed16(0x8000);
+ m_stream->update();
+ m_output = 0;
}
+void mea8000_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ for (int samp = 0; samp < samples; samp++)
+ {
+ outputs[0][samp] = m_output;
+ }
+}
+
/* next sample in frame, sampling at 64 kHz */
TIMER_CALLBACK_MEMBER( mea8000_device::timer_expire )
{
@@ -446,13 +440,15 @@ TIMER_CALLBACK_MEMBER( mea8000_device::timer_expire )
/* sample is really computed only every 8-th time */
m_lastsample = m_sample;
m_sample = compute_sample();
- m_dac->write_signed16(0x8000 + m_lastsample);
+ m_stream->update();
+ m_output = m_lastsample;
}
else
{
/* other samples are simply interpolated */
int sample = m_lastsample + ((pos * (m_sample-m_lastsample)) / SUPERSAMPLING);
- m_dac->write_signed16(0x8000 + sample);
+ m_stream->update();
+ m_output = sample;
}
m_framepos++;
diff --git a/src/mame/audio/mea8000.h b/src/devices/sound/mea8000.h
index fcda2267a80..155249729b9 100644
--- a/src/mame/audio/mea8000.h
+++ b/src/devices/sound/mea8000.h
@@ -11,8 +11,6 @@
#ifndef __MEA8000_H__
#define __MEA8000_H__
-#include "sound/dac.h"
-
#define MCFG_MEA8000_DAC(_tag) \
mea8000_device::static_set_dac_tag(*device, "^" _tag);
@@ -54,13 +52,13 @@ struct filter_t
#endif
};
-class mea8000_device : public device_t
+class mea8000_device : public device_t,
+ public device_sound_interface
{
public:
mea8000_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
~mea8000_device() {}
- static void static_set_dac_tag(device_t &device, const char *tag) { downcast<mea8000_device &>(device).m_dac.set_tag(tag); }
template<class _Object> static devcb_base &set_req_wr_callback(device_t &device, _Object object) { return downcast<mea8000_device &>(device).m_write_req.set_callback(object); }
DECLARE_READ8_MEMBER(read);
@@ -69,7 +67,7 @@ public:
protected:
// device-level overrides
virtual void device_start() override;
- virtual void device_reset() override;
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override;
private:
// internal state
@@ -100,8 +98,6 @@ private:
devcb_write8 m_write_req;
- required_device<dac_device> m_dac;
-
/* state */
mea8000_state m_state; /* current state */
@@ -126,6 +122,8 @@ private:
UINT8 m_noise;
emu_timer *m_timer;
+ sound_stream * m_stream;
+ stream_sample_t m_output;
int m_cos_table[TABLE_LEN]; /* fm => cos coefficient */
int m_exp_table[TABLE_LEN]; /* bw => exp coefficient */
diff --git a/src/devices/sound/volt_reg.cpp b/src/devices/sound/volt_reg.cpp
new file mode 100644
index 00000000000..11ac2ad47c2
--- /dev/null
+++ b/src/devices/sound/volt_reg.cpp
@@ -0,0 +1,33 @@
+// license:BSD-3-Clause
+// copyright-holders:smf
+/***************************************************************************
+
+ volt_reg.c
+
+ Direct current.
+
+***************************************************************************/
+
+#include "volt_reg.h"
+
+const device_type VOLTAGE_REGULATOR = &device_creator<voltage_regulator_device>;
+
+voltage_regulator_device::voltage_regulator_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ device_t(mconfig, VOLTAGE_REGULATOR, "Voltage Regulator", tag, owner, clock, "volt_reg", __FILE__),
+ device_sound_interface(mconfig, *this),
+ m_output(0)
+{
+}
+
+void voltage_regulator_device::device_start()
+{
+ m_stream = stream_alloc(0, 1, 500);
+}
+
+void voltage_regulator_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ for (int samp = 0; samp < samples; samp++)
+ {
+ outputs[0][samp] = m_output;
+ }
+}
diff --git a/src/devices/sound/volt_reg.h b/src/devices/sound/volt_reg.h
new file mode 100644
index 00000000000..d8ca9b163f5
--- /dev/null
+++ b/src/devices/sound/volt_reg.h
@@ -0,0 +1,44 @@
+// license:BSD-3-Clause
+// copyright-holders:smf
+/***************************************************************************
+
+ volt_reg.h
+
+ Voltage Regulator
+
+***************************************************************************/
+
+#ifndef __VOLTAGE_REGULATOR_H__
+#define __VOLTAGE_REGULATOR_H__
+
+#include "emu.h"
+
+#define MCFG_VOLTAGE_REGULATOR_OUTPUT(_output) \
+ voltage_regulator_device::set_output(*device, _output);
+
+class voltage_regulator_device : public device_t,
+ public device_sound_interface
+{
+public:
+ static void set_output(device_t &device, double analogue_dc) { downcast<voltage_regulator_device &>(device).m_output = (analogue_dc * 32768) / 5.0f; }
+
+ voltage_regulator_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~voltage_regulator_device() { }
+
+ virtual bool issound() override { return false; }
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override;
+
+private:
+ sound_stream* m_stream;
+ stream_sample_t m_output;
+};
+
+extern const device_type VOLTAGE_REGULATOR;
+
+#endif
diff --git a/src/emu/disound.h b/src/emu/disound.h
index f981113317e..2fca3860283 100644
--- a/src/emu/disound.h
+++ b/src/emu/disound.h
@@ -81,6 +81,8 @@ public:
device_sound_interface(const machine_config &mconfig, device_t &device);
virtual ~device_sound_interface();
+ virtual bool issound() { return true; } /// HACK: allow devices to hide from the ui
+
// configuration access
const std::vector<std::unique_ptr<sound_route>> &routes() const { return m_route_list; }
diff --git a/src/frontend/mame/info.cpp b/src/frontend/mame/info.cpp
index 1d1468643c6..c35f9e8d743 100644
--- a/src/frontend/mame/info.cpp
+++ b/src/frontend/mame/info.cpp
@@ -692,7 +692,7 @@ void info_xml_creator::output_chips(device_t &device, const char *root_tag)
// iterate over sound devices
for (device_sound_interface &sound : sound_interface_iterator(device))
{
- if (strcmp(sound.device().tag(), device.tag()))
+ if (strcmp(sound.device().tag(), device.tag()) != 0 && sound.issound())
{
std::string newtag(sound.device().tag()), oldtag(":");
newtag = newtag.substr(newtag.find(oldtag.append(root_tag)) + oldtag.length());
diff --git a/src/frontend/mame/ui/devopt.cpp b/src/frontend/mame/ui/devopt.cpp
index 9ebfd7f70e5..120ff1d774e 100644
--- a/src/frontend/mame/ui/devopt.cpp
+++ b/src/frontend/mame/ui/devopt.cpp
@@ -112,7 +112,7 @@ void menu_device_config::populate()
std::unordered_set<std::string> soundtags;
for (device_sound_interface &sound : snditer)
{
- if (!soundtags.insert(sound.device().tag()).second)
+ if (!sound.issound() || !soundtags.insert(sound.device().tag()).second)
continue;
// count how many identical sound chips we have
diff --git a/src/frontend/mame/ui/info.cpp b/src/frontend/mame/ui/info.cpp
index 4dfc260be57..8d5d468332b 100644
--- a/src/frontend/mame/ui/info.cpp
+++ b/src/frontend/mame/ui/info.cpp
@@ -243,7 +243,7 @@ std::string machine_info::game_info_string()
bool found_sound = false;
for (device_sound_interface &sound : snditer)
{
- if (!soundtags.insert(sound.device().tag()).second)
+ if (!sound.issound() || !soundtags.insert(sound.device().tag()).second)
continue;
// append the Sound: string
diff --git a/src/mame/audio/alesis.cpp b/src/mame/audio/alesis.cpp
index 7a253db43a2..fdd2c00fc05 100644
--- a/src/mame/audio/alesis.cpp
+++ b/src/mame/audio/alesis.cpp
@@ -13,6 +13,7 @@
#include "emu.h"
#include "includes/alesis.h"
+#include "sound/volt_reg.h"
#define LOG 1
@@ -24,10 +25,11 @@ const device_type ALESIS_DM3AG = &device_creator<alesis_dm3ag_device>;
***************************************************************************/
static MACHINE_CONFIG_FRAGMENT( alesis_dm3ag )
- MCFG_SPEAKER_STANDARD_STEREO("out1_left", "out1_right")
- MCFG_SOUND_ADD("dac", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "out1_left", 1.0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "out1_right", 1.0)
+ MCFG_SPEAKER_STANDARD_STEREO("lspeaker1", "rspeaker1")
+ MCFG_SPEAKER_STANDARD_STEREO("lspeaker2", "rspeaker2")
+ MCFG_SOUND_ADD("dac", PCM54HP, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker1", 1.0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker1", 1.0) // PCM54HP DAC + R63/R73-75 + Sample and hold
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
//-------------------------------------------------
@@ -114,7 +116,7 @@ void alesis_dm3ag_device::device_timer(emu_timer &timer, device_timer_id id, int
sample = m_samples[m_cur_sample++];
}
- m_dac->write_signed16((sample << m_shift) + 0x8000);
+ m_dac->write(sample << m_shift);
}
}
diff --git a/src/mame/audio/cchasm.cpp b/src/mame/audio/cchasm.cpp
index b4474772a34..ad41d560061 100644
--- a/src/mame/audio/cchasm.cpp
+++ b/src/mame/audio/cchasm.cpp
@@ -11,7 +11,6 @@
#include "machine/z80ctc.h"
#include "includes/cchasm.h"
#include "sound/ay8910.h"
-#include "sound/dac.h"
WRITE8_MEMBER(cchasm_state::reset_coin_flag_w)
@@ -102,9 +101,8 @@ WRITE_LINE_MEMBER(cchasm_state::ctc_timer_1_w)
{
if (state) /* rising edge */
{
- m_output[0] ^= 0x7f;
- m_channel_active[0] = 1;
- m_dac1->write_unsigned8(m_output[0]);
+ m_output[0] = !m_output[0];
+ m_dac1->write(m_output[0]);
}
}
@@ -112,9 +110,8 @@ WRITE_LINE_MEMBER(cchasm_state::ctc_timer_2_w)
{
if (state) /* rising edge */
{
- m_output[1] ^= 0x7f;
- m_channel_active[1] = 1;
- m_dac2->write_unsigned8(m_output[0]);
+ m_output[1] = !m_output[1];
+ m_dac2->write(m_output[1]);
}
}
@@ -127,6 +124,5 @@ void cchasm_state::sound_start()
save_item(NAME(m_sound_flags));
save_item(NAME(m_coin_flag));
- save_item(NAME(m_channel_active));
save_item(NAME(m_output));
}
diff --git a/src/mame/audio/cclimber.cpp b/src/mame/audio/cclimber.cpp
index fb9bc5901ab..bd20ab77b17 100644
--- a/src/mame/audio/cclimber.cpp
+++ b/src/mame/audio/cclimber.cpp
@@ -22,12 +22,12 @@ SAMPLES_START_CB_MEMBER( cclimber_audio_device::sh_start )
MACHINE_CONFIG_FRAGMENT( cclimber_audio )
MCFG_SOUND_ADD("aysnd", AY8910, SND_CLOCK/2)
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(cclimber_audio_device, sample_select_w))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, ":mono", 0.50)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, ":speaker", 0.5)
MCFG_SOUND_ADD("samples", SAMPLES, 0)
MCFG_SAMPLES_CHANNELS(1)
MCFG_SAMPLES_START_CB(cclimber_audio_device, sh_start)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, ":mono", 0.5)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, ":speaker", 0.5)
MACHINE_CONFIG_END
//**************************************************************************
diff --git a/src/mame/audio/cyberbal.cpp b/src/mame/audio/cyberbal.cpp
index 32a9403a2f6..07ec31523e4 100644
--- a/src/mame/audio/cyberbal.cpp
+++ b/src/mame/audio/cyberbal.cpp
@@ -136,8 +136,15 @@ WRITE16_MEMBER(cyberbal_state::sound_68k_w)
WRITE16_MEMBER(cyberbal_state::sound_68k_dac_w)
{
- dac_device *dac = (offset & 8) ? m_dac2 : m_dac1;
- dac->write_unsigned16((((data >> 3) & 0x800) | ((data >> 2) & 0x7ff)) << 4);
+ //int clip = BIT(data, 15);
+ //int off0b = BIT(data, 13) | BIT(data, 14);
+ //int off4b = BIT(data, 13) & BIT(data, 14);
+ uint16 sample = ((data >> 3) & 0x800) | ((data >> 2) & 0x7ff);
+
+ if (offset & 8)
+ m_ldac->write(sample);
+ else
+ m_rdac->write(sample);
if (m_fast_68k_int)
{
diff --git a/src/mame/audio/galaxian.cpp b/src/mame/audio/galaxian.cpp
index 95598d41d1d..ca4505c00e9 100644
--- a/src/mame/audio/galaxian.cpp
+++ b/src/mame/audio/galaxian.cpp
@@ -509,20 +509,20 @@ void galaxian_sound_device::sound_stream_update(sound_stream &stream, stream_sam
MACHINE_CONFIG_FRAGMENT( galaxian_audio )
MCFG_SOUND_ADD("cust", GALAXIAN, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.4)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.4)
MCFG_SOUND_ADD(GAL_AUDIO, DISCRETE, 0)
MCFG_DISCRETE_INTF(galaxian)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
MACHINE_CONFIG_FRAGMENT( mooncrst_audio )
MCFG_SOUND_ADD("cust", GALAXIAN, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.4)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.4)
MCFG_SOUND_ADD(GAL_AUDIO, DISCRETE, 0)
MCFG_DISCRETE_INTF(mooncrst)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/audio/gottlieb.cpp b/src/mame/audio/gottlieb.cpp
index 5f5fc4cad69..17db18103dd 100644
--- a/src/mame/audio/gottlieb.cpp
+++ b/src/mame/audio/gottlieb.cpp
@@ -11,6 +11,8 @@
***************************************************************************/
#include "audio/gottlieb.h"
+#include "sound/dac.h"
+#include "sound/volt_reg.h"
#define SOUND1_CLOCK XTAL_3_579545MHz
@@ -234,14 +236,14 @@ MACHINE_CONFIG_FRAGMENT( reactor_samples )
MCFG_SOUND_ADD("samples", SAMPLES, 0)
MCFG_SAMPLES_CHANNELS(1)
MCFG_SAMPLES_NAMES(reactor_sample_names)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
MACHINE_CONFIG_FRAGMENT( qbert_samples )
MCFG_SOUND_ADD("samples", SAMPLES, 0)
MCFG_SAMPLES_CHANNELS(1)
MCFG_SAMPLES_NAMES(qbert_sample_names)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
#endif
@@ -260,7 +262,6 @@ gottlieb_sound_r0_device::gottlieb_sound_r0_device(const machine_config &mconfig
, device_mixer_interface(mconfig, *this)
, m_audiocpu(*this, "audiocpu")
, m_r6530(*this, "r6530")
- , m_dac(*this, "dac")
, m_sndcmd(0)
{
}
@@ -313,12 +314,13 @@ MACHINE_CONFIG_FRAGMENT( gottlieb_sound_r0 )
// I/O configuration
MCFG_DEVICE_ADD("r6530", MOS6530, SOUND1_CLOCK/4) // unknown - same as cpu
- MCFG_MOS6530_OUT_PA_CB(DEVWRITE8("dac", dac_device, write_unsigned8))
+ MCFG_MOS6530_OUT_PA_CB(DEVWRITE8("dac", dac_byte_interface, write))
MCFG_MOS6530_IN_PB_CB(READ8(gottlieb_sound_r0_device, r6530b_r))
// sound devices
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.50)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.25) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
@@ -385,7 +387,6 @@ gottlieb_sound_r1_device::gottlieb_sound_r1_device(const machine_config &mconfig
device_mixer_interface(mconfig, *this),
m_audiocpu(*this, "audiocpu"),
m_riot(*this, "riot"),
- m_dac(*this, "dac"),
m_votrax(*this, "votrax"),
//m_populate_votrax(false),
m_last_speech_clock(0)
@@ -403,7 +404,6 @@ gottlieb_sound_r1_device::gottlieb_sound_r1_device(const machine_config &mconfig
device_mixer_interface(mconfig, *this),
m_audiocpu(*this, "audiocpu"),
m_riot(*this, "riot"),
- m_dac(*this, "dac"),
m_votrax(*this, "votrax"),
//m_populate_votrax(populate_votrax),
m_last_speech_clock(0)
@@ -522,7 +522,7 @@ static ADDRESS_MAP_START( gottlieb_sound_r1_map, AS_PROGRAM, 8, gottlieb_sound_r
ADDRESS_MAP_GLOBAL_MASK(0x7fff)
AM_RANGE(0x0000, 0x007f) AM_MIRROR(0x0d80) AM_RAM
AM_RANGE(0x0200, 0x021f) AM_MIRROR(0x0de0) AM_DEVREADWRITE("riot", riot6532_device, read, write)
- AM_RANGE(0x1000, 0x1000) AM_MIRROR(0x0fff) AM_DEVWRITE("dac", dac_device, write_unsigned8)
+ AM_RANGE(0x1000, 0x1000) AM_MIRROR(0x0fff) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(0x2000, 0x2000) AM_MIRROR(0x0fff) AM_WRITE(votrax_data_w)
AM_RANGE(0x3000, 0x3000) AM_MIRROR(0x0fff) AM_WRITE(speech_clock_dac_w)
AM_RANGE(0x6000, 0x7fff) AM_ROM
@@ -545,8 +545,9 @@ MACHINE_CONFIG_FRAGMENT( gottlieb_sound_r1 )
MCFG_RIOT6532_IRQ_CB(WRITELINE(gottlieb_sound_r1_device, snd_interrupt))
// sound devices
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.50)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.25) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
MACHINE_CONFIG_FRAGMENT( gottlieb_sound_r1_with_votrax )
@@ -555,7 +556,7 @@ MACHINE_CONFIG_FRAGMENT( gottlieb_sound_r1_with_votrax )
// add the VOTRAX
MCFG_DEVICE_ADD("votrax", VOTRAX_SC01, 720000)
MCFG_VOTRAX_SC01_REQUEST_CB(DEVWRITELINE(DEVICE_SELF, gottlieb_sound_r1_device, votrax_request))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.50)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.5)
MACHINE_CONFIG_END
@@ -667,7 +668,6 @@ gottlieb_sound_r2_device::gottlieb_sound_r2_device(const machine_config &mconfig
device_mixer_interface(mconfig, *this),
m_audiocpu(*this, "audiocpu"),
m_speechcpu(*this, "speechcpu"),
- m_dac(*this, "dac"),
m_ay1(*this, "ay1"),
m_ay2(*this, "ay2"),
m_sp0250(*this, "spsnd"),
@@ -803,20 +803,6 @@ CUSTOM_INPUT_MEMBER( gottlieb_sound_r2_device::speech_drq_custom_r )
//-------------------------------------------------
-// dac_w - write to one of the two DACs on the
-// board
-//-------------------------------------------------
-
-WRITE8_MEMBER( gottlieb_sound_r2_device::dac_w )
-{
- // dual DAC; the first DAC serves as the reference voltage for the
- // second, effectively scaling the output
- m_dac_data[offset] = data;
- m_dac->write_unsigned16(m_dac_data[0] * m_dac_data[1]);
-}
-
-
-//-------------------------------------------------
// speech_control_w - primary audio control
// register on the speech board
//-------------------------------------------------
@@ -900,7 +886,8 @@ WRITE8_MEMBER( gottlieb_sound_r2_device::sp0250_latch_w )
static ADDRESS_MAP_START( gottlieb_sound_r2_map, AS_PROGRAM, 8, gottlieb_sound_r2_device )
AM_RANGE(0x0000, 0x03ff) AM_MIRROR(0x3c00) AM_RAM
- AM_RANGE(0x4000, 0x4001) AM_MIRROR(0x3ffe) AM_WRITE(dac_w)
+ AM_RANGE(0x4000, 0x4000) AM_MIRROR(0x3ffe) AM_DEVWRITE("dacvol", dac_byte_interface, write)
+ AM_RANGE(0x4001, 0x4001) AM_MIRROR(0x3ffe) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(0x8000, 0x8000) AM_MIRROR(0x3fff) AM_READ(audio_data_r)
AM_RANGE(0xc000, 0xdfff) AM_MIRROR(0x2000) AM_ROM
ADDRESS_MAP_END
@@ -936,8 +923,11 @@ MACHINE_CONFIG_FRAGMENT( gottlieb_sound_r2 )
MCFG_CPU_PROGRAM_MAP(gottlieb_speech_r2_map)
// sound hardware
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.15)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.075) // unknown DAC
+ MCFG_SOUND_ADD("dacvol", DAC_8BIT_R2R, 0) // unknown DAC
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dacvol", 1.0, DAC_VREF_POS_INPUT)
MCFG_SOUND_ADD("ay1", AY8913, SOUND2_CLOCK/2)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.15)
@@ -1002,9 +992,6 @@ void gottlieb_sound_r2_device::device_start()
m_nmi_rate = 0;
nmi_timer_adjust();
- // reset the DACs
- m_dac_data[0] = m_dac_data[1] = 0xff;
-
// disable the non-speech CPU for cobram3
if (m_cobram3_mod)
m_audiocpu->set_input_line(INPUT_LINE_HALT, ASSERT_LINE);
@@ -1050,3 +1037,4 @@ void gottlieb_sound_r2_device::device_timer(emu_timer &timer, device_timer_id id
break;
}
}
+
diff --git a/src/mame/audio/gottlieb.h b/src/mame/audio/gottlieb.h
index 6295af33542..cb5f678586b 100644
--- a/src/mame/audio/gottlieb.h
+++ b/src/mame/audio/gottlieb.h
@@ -10,7 +10,6 @@
#include "cpu/m6502/m6502.h"
#include "machine/mos6530.h"
#include "machine/6532riot.h"
-#include "sound/dac.h"
#include "sound/ay8910.h"
#include "sound/sp0250.h"
#include "sound/votrax.h"
@@ -36,18 +35,7 @@ extern const device_type GOTTLIEB_SOUND_REV2;
// DEVICE CONFIGURATION MACROS
//**************************************************************************
-#define MCFG_GOTTLIEB_SOUND_R0_ADD(_tag) \
- MCFG_DEVICE_ADD(_tag, GOTTLIEB_SOUND_REV0, 0)
-
-#define MCFG_GOTTLIEB_SOUND_R1_ADD(_tag) \
- MCFG_DEVICE_ADD(_tag, GOTTLIEB_SOUND_REV1, 0)
-#define MCFG_GOTTLIEB_SOUND_R1_ADD_VOTRAX(_tag) \
- MCFG_DEVICE_ADD(_tag, GOTTLIEB_SOUND_REV1_WITH_VOTRAX, 0)
-
-#define MCFG_GOTTLIEB_SOUND_R2_ADD(_tag) \
- MCFG_DEVICE_ADD(_tag, GOTTLIEB_SOUND_REV2, 0)
-#define MCFG_GOTTLIEB_SOUND_R2_ADD_COBRAM3(_tag) \
- MCFG_DEVICE_ADD(_tag, GOTTLIEB_SOUND_REV2, 0) \
+#define MCFG_GOTTLIEB_ENABLE_COBRAM3_MODS() \
gottlieb_sound_r2_device::static_enable_cobram3_mods(*device);
@@ -81,7 +69,6 @@ private:
// devices
required_device<m6502_device> m_audiocpu;
required_device<mos6530_device> m_r6530;
- required_device<dac_device> m_dac;
UINT8 m_sndcmd;
};
@@ -116,7 +103,6 @@ private:
// devices
required_device<m6502_device> m_audiocpu;
required_device<riot6532_device> m_riot;
- required_device<dac_device> m_dac;
optional_device<votrax_sc01_device> m_votrax;
// internal state
@@ -172,7 +158,6 @@ public:
DECLARE_WRITE8_MEMBER( signal_audio_nmi_w );
DECLARE_WRITE8_MEMBER( nmi_rate_w );
CUSTOM_INPUT_MEMBER( speech_drq_custom_r );
- DECLARE_WRITE8_MEMBER( dac_w );
DECLARE_WRITE8_MEMBER( speech_control_w );
DECLARE_WRITE8_MEMBER( sp0250_latch_w );
DECLARE_WRITE8_MEMBER( psg_latch_w );
@@ -200,7 +185,6 @@ private:
// devices
required_device<m6502_device> m_audiocpu;
required_device<m6502_device> m_speechcpu;
- required_device<dac_device> m_dac;
required_device<ay8913_device> m_ay1;
required_device<ay8913_device> m_ay2;
optional_device<sp0250_device> m_sp0250;
@@ -214,7 +198,6 @@ private:
UINT8 m_speechcpu_latch;
UINT8 m_speech_control;
UINT8 m_last_command;
- UINT8 m_dac_data[2];
UINT8 m_psg_latch;
UINT8 m_psg_data_latch;
UINT8 m_sp0250_latch;
diff --git a/src/mame/audio/harddriv.cpp b/src/mame/audio/harddriv.cpp
index f45c4755fea..7c38118370a 100644
--- a/src/mame/audio/harddriv.cpp
+++ b/src/mame/audio/harddriv.cpp
@@ -7,10 +7,10 @@
****************************************************************************/
#include "emu.h"
+#include "includes/harddriv.h"
#include "cpu/tms32010/tms32010.h"
-#include "sound/dac.h"
#include "machine/atarigen.h"
-#include "includes/harddriv.h"
+#include "sound/volt_reg.h"
#define BIO_FREQUENCY (1000000 / 50)
@@ -38,7 +38,6 @@ harddriv_sound_board_device::harddriv_sound_board_device(const machine_config &m
m_mainflag(0),
m_sounddata(0),
m_maindata(0),
- m_dacmute(0),
m_cramen(0),
m_irq68k(0),
m_sound_rom_offs(0),
@@ -325,9 +324,8 @@ READ_LINE_MEMBER(harddriv_sound_board_device::hdsnddsp_get_bio)
WRITE16_MEMBER(harddriv_sound_board_device::hdsnddsp_dac_w)
{
- /* DAC L */
- if (!m_dacmute)
- m_dac->write_signed16(data ^ 0x8000);
+ /* /DACL */
+ m_dac->write((data >> 4) ^ 0x800); // schematics show d0-3 are ignored & the msb is inverted
}
@@ -341,7 +339,6 @@ WRITE16_MEMBER(harddriv_sound_board_device::hdsnddsp_comport_w)
WRITE16_MEMBER(harddriv_sound_board_device::hdsnddsp_mute_w)
{
/* mute DAC audio, D0=1 */
-/* m_dacmute = data & 1; -- NOT STUFFED */
logerror("%06X:mute DAC=%d\n", space.device().safe_pcbase(), data);
}
@@ -413,7 +410,7 @@ ADDRESS_MAP_END
/* $000 - 08F TMS32010 Internal Data RAM in Data Address Space */
static ADDRESS_MAP_START( driversnd_dsp_io_map, AS_IO, 16, harddriv_sound_board_device )
- AM_RANGE(0, 0) AM_READWRITE(hdsnddsp_rom_r, hdsnddsp_dac_w)
+ AM_RANGE(0, 0) AM_READ(hdsnddsp_rom_r) AM_WRITE(hdsnddsp_dac_w)
AM_RANGE(1, 1) AM_READ(hdsnddsp_comram_r)
AM_RANGE(2, 2) AM_READ(hdsnddsp_compare_r)
AM_RANGE(1, 2) AM_WRITENOP
@@ -437,10 +434,11 @@ static MACHINE_CONFIG_FRAGMENT( harddriv_snd )
MCFG_TMS32010_BIO_IN_CB(READLINE(harddriv_sound_board_device, hdsnddsp_get_bio))
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ADD("dac", AM6012, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) // ls374d.75e + ls374d.90e + am6012
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
//-------------------------------------------------
diff --git a/src/mame/audio/hyprolyb.cpp b/src/mame/audio/hyprolyb.cpp
index c7402dd4dcf..3e9b29d356c 100644
--- a/src/mame/audio/hyprolyb.cpp
+++ b/src/mame/audio/hyprolyb.cpp
@@ -114,7 +114,7 @@ MACHINE_CONFIG_FRAGMENT( hyprolyb_adpcm )
MCFG_SOUND_ADD("msm", MSM5205, 384000)
MCFG_MSM5205_VCLK_CB(DEVWRITELINE("hyprolyb_adpcm", hyprolyb_adpcm_device, vck_callback)) /* VCK function */
MCFG_MSM5205_PRESCALER_SELECTOR(MSM5205_S96_4B) /* 4 kHz */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
MACHINE_CONFIG_END
diff --git a/src/mame/audio/jaguar.cpp b/src/mame/audio/jaguar.cpp
index e3d09c6ef8a..441e25fd236 100644
--- a/src/mame/audio/jaguar.cpp
+++ b/src/mame/audio/jaguar.cpp
@@ -334,12 +334,12 @@ WRITE32_MEMBER( jaguar_state::serial_w )
{
/* right DAC */
case 2:
- m_dac2->write_signed16((data & 0xffff) ^ 0x8000);
+ m_rdac->write(data & 0xffff);
break;
/* left DAC */
case 3:
- m_dac1->write_signed16((data & 0xffff) ^ 0x8000);
+ m_ldac->write(data & 0xffff);
break;
/* frequency register */
diff --git a/src/mame/audio/leland.cpp b/src/mame/audio/leland.cpp
index 6cf7e4740ad..260e775df58 100644
--- a/src/mame/audio/leland.cpp
+++ b/src/mame/audio/leland.cpp
@@ -10,7 +10,7 @@
-------------------------------------------------------------------
1st generation sound hardware was controlled by the master Z80.
- It drove an AY-8910/AY-8912 pair for music. It also had two DACs
+ It drove either an AY-8910/AY-8912 for music. It also had two DACs
that were driven by the video refresh. At the end of each scanline
there are 8-bit DAC samples that can be enabled via the output
ports on the AY-8910. The DACs run at a fixed frequency of 15.3kHz,
@@ -80,8 +80,9 @@
***************************************************************************/
#include "emu.h"
-#include "cpu/z80/z80.h"
#include "includes/leland.h"
+#include "cpu/z80/z80.h"
+#include "sound/volt_reg.h"
#define LOG_COMM 0
#define LOG_EXTERN 0
@@ -112,11 +113,6 @@ WRITE_LINE_MEMBER(leland_80186_sound_device::pit1_2_w)
set_clock_line(5, state);
}
-WRITE_LINE_MEMBER(leland_80186_sound_device::pit2_0_w)
-{
- set_clock_line(5, state);
-}
-
WRITE_LINE_MEMBER(leland_80186_sound_device::i80186_tmr0_w)
{
set_clock_line(6, state);
@@ -128,7 +124,7 @@ WRITE_LINE_MEMBER(leland_80186_sound_device::i80186_tmr1_w)
{
if (m_ext_active && (m_ext_start < m_ext_stop))
{
- m_dac4->write_signed8(m_ext_base[m_ext_start]);
+ m_dac4->write(m_ext_base[m_ext_start]);
m_ext_start++;
}
}
@@ -137,20 +133,27 @@ WRITE_LINE_MEMBER(leland_80186_sound_device::i80186_tmr1_w)
static MACHINE_CONFIG_FRAGMENT( leland_80186_sound )
MCFG_SPEAKER_STANDARD_MONO("speaker")
- MCFG_SOUND_ADD("dac1", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.40)
- MCFG_SOUND_ADD("dac2", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.40)
- MCFG_SOUND_ADD("dac3", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.40)
- MCFG_SOUND_ADD("dac4", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.40)
- MCFG_SOUND_ADD("dac5", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.40)
- MCFG_SOUND_ADD("dac6", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.40)
- MCFG_SOUND_ADD("dac7", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.00)
+ MCFG_SOUND_ADD("dac1", AD7524, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.2) // 74hc374.u31 + ad7524.u46
+ MCFG_SOUND_ADD("dac2", AD7524, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.2) // 74hc374.u32 + ad7524.u47
+ MCFG_SOUND_ADD("dac3", AD7524, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.2) // 74hc374.u33 + ad7524.u48
+ MCFG_SOUND_ADD("dac4", AD7524, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.2) // 74hc374.u34 + ad7524.u49
+ MCFG_SOUND_ADD("dac5", AD7524, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.2) // 74hc374.u35 + ad7524.u50
+ MCFG_SOUND_ADD("dac6", AD7524, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.2) // 74hc374.u36 + ad7524.u51
+ MCFG_SOUND_ADD("dac9", AD7533, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0) // ad7533.u64
+ MCFG_SOUND_ADD("dac1vol", DAC_8BIT_BINARY_WEIGHTED, 0) MCFG_SOUND_ROUTE_EX(0, "dac1", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac1", -1.0, DAC_VREF_NEG_INPUT) // 74hc374.u17 + r2-r9 (24k,12k,6.2k,3k,1.5k,750,360,160)
+ MCFG_SOUND_ADD("dac2vol", DAC_8BIT_BINARY_WEIGHTED, 0) MCFG_SOUND_ROUTE_EX(0, "dac2", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac2", -1.0, DAC_VREF_NEG_INPUT) // 74hc374.u18 + r12-r19 (24k,12k,6.2k,3k,1.5k,750,360,160)
+ MCFG_SOUND_ADD("dac3vol", DAC_8BIT_BINARY_WEIGHTED, 0) MCFG_SOUND_ROUTE_EX(0, "dac3", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac3", -1.0, DAC_VREF_NEG_INPUT) // 74hc374.u19 + r22-r29 (24k,12k,6.2k,3k,1.5k,750,360,160)
+ MCFG_SOUND_ADD("dac4vol", DAC_8BIT_BINARY_WEIGHTED, 0) MCFG_SOUND_ROUTE_EX(0, "dac4", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac4", -1.0, DAC_VREF_NEG_INPUT) // 74hc374.u20 + r32-r39 (24k,12k,6.2k,3k,1.5k,750,360,160)
+ MCFG_SOUND_ADD("dac5vol", DAC_8BIT_BINARY_WEIGHTED, 0) MCFG_SOUND_ROUTE_EX(0, "dac5", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac5", -1.0, DAC_VREF_NEG_INPUT) // 74hc374.u21 + r42-r49 (24k,12k,6.2k,3k,1.5k,750,360,160)
+ MCFG_SOUND_ADD("dac6vol", DAC_8BIT_BINARY_WEIGHTED, 0) MCFG_SOUND_ROUTE_EX(0, "dac6", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac6", -1.0, DAC_VREF_NEG_INPUT) // 74hc374.u22 + r52-r59 (24k,12k,6.2k,3k,1.5k,750,360,160)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac1vol", 1.0, DAC_VREF_POS_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac2vol", 1.0, DAC_VREF_POS_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac3vol", 1.0, DAC_VREF_POS_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac4vol", 1.0, DAC_VREF_POS_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac5vol", 1.0, DAC_VREF_POS_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac6vol", 1.0, DAC_VREF_POS_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac9", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac9", -1.0, DAC_VREF_NEG_INPUT)
MCFG_DEVICE_ADD("pit0", PIT8254, 0)
MCFG_PIT8253_CLK0(4000000)
@@ -171,22 +174,31 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_FRAGMENT( redline_80186_sound )
MCFG_SPEAKER_STANDARD_MONO("speaker")
- MCFG_SOUND_ADD("dac1", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.40)
- MCFG_SOUND_ADD("dac2", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.40)
- MCFG_SOUND_ADD("dac3", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.40)
- MCFG_SOUND_ADD("dac4", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.40)
- MCFG_SOUND_ADD("dac5", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.40)
- MCFG_SOUND_ADD("dac6", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.40)
- MCFG_SOUND_ADD("dac7", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.40)
- MCFG_SOUND_ADD("dac8", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.40)
+ MCFG_SOUND_ADD("dac1", AD7524, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.2) // unknown DAC
+ MCFG_SOUND_ADD("dac2", AD7524, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.2) // unknown DAC
+ MCFG_SOUND_ADD("dac3", AD7524, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.2) // unknown DAC
+ MCFG_SOUND_ADD("dac4", AD7524, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.2) // unknown DAC
+ MCFG_SOUND_ADD("dac5", AD7524, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.2) // unknown DAC
+ MCFG_SOUND_ADD("dac6", AD7524, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.2) // unknown DAC
+ MCFG_SOUND_ADD("dac7", AD7524, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.2) // unknown DAC
+ MCFG_SOUND_ADD("dac8", AD7524, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.2) // unknown DAC
+ MCFG_SOUND_ADD("dac1vol", DAC_8BIT_BINARY_WEIGHTED, 0) MCFG_SOUND_ROUTE_EX(0, "dac1", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac1", -1.0, DAC_VREF_NEG_INPUT) // unknown DAC
+ MCFG_SOUND_ADD("dac2vol", DAC_8BIT_BINARY_WEIGHTED, 0) MCFG_SOUND_ROUTE_EX(0, "dac2", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac2", -1.0, DAC_VREF_NEG_INPUT) // unknown DAC
+ MCFG_SOUND_ADD("dac3vol", DAC_8BIT_BINARY_WEIGHTED, 0) MCFG_SOUND_ROUTE_EX(0, "dac3", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac3", -1.0, DAC_VREF_NEG_INPUT) // unknown DAC
+ MCFG_SOUND_ADD("dac4vol", DAC_8BIT_BINARY_WEIGHTED, 0) MCFG_SOUND_ROUTE_EX(0, "dac4", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac4", -1.0, DAC_VREF_NEG_INPUT) // unknown DAC
+ MCFG_SOUND_ADD("dac5vol", DAC_8BIT_BINARY_WEIGHTED, 0) MCFG_SOUND_ROUTE_EX(0, "dac5", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac5", -1.0, DAC_VREF_NEG_INPUT) // unknown DAC
+ MCFG_SOUND_ADD("dac6vol", DAC_8BIT_BINARY_WEIGHTED, 0) MCFG_SOUND_ROUTE_EX(0, "dac6", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac6", -1.0, DAC_VREF_NEG_INPUT) // unknown DAC
+ MCFG_SOUND_ADD("dac7vol", DAC_8BIT_BINARY_WEIGHTED, 0) MCFG_SOUND_ROUTE_EX(0, "dac7", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac7", -1.0, DAC_VREF_NEG_INPUT) // unknown DAC
+ MCFG_SOUND_ADD("dac8vol", DAC_8BIT_BINARY_WEIGHTED, 0) MCFG_SOUND_ROUTE_EX(0, "dac8", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac8", -1.0, DAC_VREF_NEG_INPUT) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac1vol", 1.0, DAC_VREF_POS_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac2vol", 1.0, DAC_VREF_POS_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac3vol", 1.0, DAC_VREF_POS_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac4vol", 1.0, DAC_VREF_POS_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac5vol", 1.0, DAC_VREF_POS_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac6vol", 1.0, DAC_VREF_POS_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac7vol", 1.0, DAC_VREF_POS_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac8vol", 1.0, DAC_VREF_POS_INPUT)
MCFG_DEVICE_ADD("pit0", PIT8254, 0)
MCFG_PIT8253_CLK0(7000000)
@@ -212,16 +224,21 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_FRAGMENT( ataxx_80186_sound )
MCFG_SPEAKER_STANDARD_MONO("speaker")
- MCFG_SOUND_ADD("dac1", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.40)
- MCFG_SOUND_ADD("dac2", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.40)
- MCFG_SOUND_ADD("dac3", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.40)
- MCFG_SOUND_ADD("dac4", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.40)
- MCFG_SOUND_ADD("dac7", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.00)
+ MCFG_SOUND_ADD("dac1", AD7524, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.2) // unknown DAC
+ MCFG_SOUND_ADD("dac2", AD7524, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.2) // unknown DAC
+ MCFG_SOUND_ADD("dac3", AD7524, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.2) // unknown DAC
+ MCFG_SOUND_ADD("dac4", AD7524, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.2) // unknown DAC
+ MCFG_SOUND_ADD("dac9", AD7533, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0) // unknown DAC
+ MCFG_SOUND_ADD("dac1vol", DAC_8BIT_BINARY_WEIGHTED, 0) MCFG_SOUND_ROUTE_EX(0, "dac1", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac1", -1.0, DAC_VREF_NEG_INPUT) // unknown DAC
+ MCFG_SOUND_ADD("dac2vol", DAC_8BIT_BINARY_WEIGHTED, 0) MCFG_SOUND_ROUTE_EX(0, "dac2", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac2", -1.0, DAC_VREF_NEG_INPUT) // unknown DAC
+ MCFG_SOUND_ADD("dac3vol", DAC_8BIT_BINARY_WEIGHTED, 0) MCFG_SOUND_ROUTE_EX(0, "dac3", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac3", -1.0, DAC_VREF_NEG_INPUT) // unknown DAC
+ MCFG_SOUND_ADD("dac4vol", DAC_8BIT_BINARY_WEIGHTED, 0) MCFG_SOUND_ROUTE_EX(0, "dac4", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac4", -1.0, DAC_VREF_NEG_INPUT) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac1vol", 1.0, DAC_VREF_POS_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac2vol", 1.0, DAC_VREF_POS_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac3vol", 1.0, DAC_VREF_POS_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac4vol", 1.0, DAC_VREF_POS_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac9", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac9", -1.0, DAC_VREF_NEG_INPUT)
MCFG_DEVICE_ADD("pit0", PIT8254, 0)
MCFG_PIT8253_CLK0(4000000)
@@ -234,16 +251,21 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_FRAGMENT( wsf_80186_sound )
MCFG_SPEAKER_STANDARD_MONO("speaker")
- MCFG_SOUND_ADD("dac1", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.40)
- MCFG_SOUND_ADD("dac2", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.40)
- MCFG_SOUND_ADD("dac3", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.40)
- MCFG_SOUND_ADD("dac4", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.40)
- MCFG_SOUND_ADD("dac7", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.00)
+ MCFG_SOUND_ADD("dac1", AD7524, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.2) // unknown DAC
+ MCFG_SOUND_ADD("dac2", AD7524, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.2) // unknown DAC
+ MCFG_SOUND_ADD("dac3", AD7524, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.2) // unknown DAC
+ MCFG_SOUND_ADD("dac4", AD7524, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.2) // unknown DAC
+ MCFG_SOUND_ADD("dac9", AD7533, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0) // unknown DAC
+ MCFG_SOUND_ADD("dac1vol", DAC_8BIT_BINARY_WEIGHTED, 0) MCFG_SOUND_ROUTE_EX(0, "dac1", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac1", -1.0, DAC_VREF_NEG_INPUT) // unknown DAC
+ MCFG_SOUND_ADD("dac2vol", DAC_8BIT_BINARY_WEIGHTED, 0) MCFG_SOUND_ROUTE_EX(0, "dac2", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac2", -1.0, DAC_VREF_NEG_INPUT) // unknown DAC
+ MCFG_SOUND_ADD("dac3vol", DAC_8BIT_BINARY_WEIGHTED, 0) MCFG_SOUND_ROUTE_EX(0, "dac3", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac3", -1.0, DAC_VREF_NEG_INPUT) // unknown DAC
+ MCFG_SOUND_ADD("dac4vol", DAC_8BIT_BINARY_WEIGHTED, 0) MCFG_SOUND_ROUTE_EX(0, "dac4", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac4", -1.0, DAC_VREF_NEG_INPUT) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac1vol", 1.0, DAC_VREF_POS_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac2vol", 1.0, DAC_VREF_POS_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac3vol", 1.0, DAC_VREF_POS_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac4vol", 1.0, DAC_VREF_POS_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac9", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac9", -1.0, DAC_VREF_NEG_INPUT)
/* sound hardware */
MCFG_YM2151_ADD("ymsnd", 4000000)
@@ -339,6 +361,15 @@ leland_80186_sound_device::leland_80186_sound_device(const machine_config &mconf
m_dac6(*this, "dac6"),
m_dac7(*this, "dac7"),
m_dac8(*this, "dac8"),
+ m_dac9(*this, "dac9"),
+ m_dac1vol(*this, "dac1vol"),
+ m_dac2vol(*this, "dac2vol"),
+ m_dac3vol(*this, "dac3vol"),
+ m_dac4vol(*this, "dac4vol"),
+ m_dac5vol(*this, "dac5vol"),
+ m_dac6vol(*this, "dac6vol"),
+ m_dac7vol(*this, "dac7vol"),
+ m_dac8vol(*this, "dac8vol"),
m_pit0(*this, "pit0"),
m_pit1(*this, "pit1"),
m_pit2(*this, "pit2"),
@@ -357,6 +388,15 @@ leland_80186_sound_device::leland_80186_sound_device(const machine_config &mconf
m_dac6(*this, "dac6"),
m_dac7(*this, "dac7"),
m_dac8(*this, "dac8"),
+ m_dac9(*this, "dac9"),
+ m_dac1vol(*this, "dac1vol"),
+ m_dac2vol(*this, "dac2vol"),
+ m_dac3vol(*this, "dac3vol"),
+ m_dac4vol(*this, "dac4vol"),
+ m_dac5vol(*this, "dac5vol"),
+ m_dac6vol(*this, "dac6vol"),
+ m_dac7vol(*this, "dac7vol"),
+ m_dac8vol(*this, "dac8vol"),
m_pit0(*this, "pit0"),
m_pit1(*this, "pit1"),
m_pit2(*this, "pit2"),
@@ -489,13 +529,6 @@ WRITE8_MEMBER( leland_80186_sound_device::leland_80186_command_hi_w )
}
-READ16_MEMBER( leland_80186_sound_device::main_to_sound_comm_r )
-{
- if (LOG_COMM) logerror("%05X:Read sound command latch = %02X\n", m_audiocpu->device_t::safe_pc(), m_sound_command);
- return m_sound_command;
-}
-
-
/*************************************
@@ -542,13 +575,6 @@ READ8_MEMBER( leland_80186_sound_device::leland_80186_response_r )
}
-WRITE16_MEMBER( leland_80186_sound_device::sound_to_main_comm_w )
-{
- if (LOG_COMM) logerror("%05X:Write sound response latch = %02X\n", m_audiocpu->device_t::safe_pc(), data);
- m_sound_response = data;
-}
-
-
/*************************************
*
@@ -558,71 +584,73 @@ WRITE16_MEMBER( leland_80186_sound_device::sound_to_main_comm_w )
WRITE16_MEMBER( leland_80186_sound_device::dac_w )
{
- int which = offset & 7;
+ int dac = offset & 7;
/* handle value changes */
if (ACCESSING_BITS_0_7)
{
- switch(which)
+ switch (dac)
{
- case 0:
- m_dac1->write_signed8(data & 0xff);
- break;
- case 1:
- m_dac2->write_signed8(data & 0xff);
- break;
- case 2:
- m_dac3->write_signed8(data & 0xff);
- break;
- case 3:
- m_dac4->write_signed8(data & 0xff);
- break;
- case 4:
- m_dac5->write_signed8(data & 0xff);
- break;
- case 5:
- m_dac6->write_signed8(data & 0xff);
- break;
- case 6:
- m_dac7->write_signed8(data & 0xff);
- break;
- case 7:
- m_dac8->write_signed8(data & 0xff);
- break;
+ case 0:
+ m_dac1->write(data & 0xff);
+ break;
+ case 1:
+ m_dac2->write(data & 0xff);
+ break;
+ case 2:
+ m_dac3->write(data & 0xff);
+ break;
+ case 3:
+ m_dac4->write(data & 0xff);
+ break;
+ case 4:
+ m_dac5->write(data & 0xff);
+ break;
+ case 5:
+ m_dac6->write(data & 0xff);
+ break;
+ case 6:
+ m_dac7->write(data & 0xff);
+ break;
+ case 7:
+ m_dac8->write(data & 0xff);
+ break;
}
- m_clock_active &= ~(1<<which);
+
+ set_clock_line(dac, 0);
}
/* handle volume changes */
if (ACCESSING_BITS_8_15)
- switch(which)
+ {
+ switch(dac)
{
- case 0:
- m_dac1->set_output_gain(ALL_OUTPUTS, (data >> 8)/255.0f);
- break;
- case 1:
- m_dac2->set_output_gain(ALL_OUTPUTS, (data >> 8)/255.0f);
- break;
- case 2:
- m_dac3->set_output_gain(ALL_OUTPUTS, (data >> 8)/255.0f);
- break;
- case 3:
- m_dac4->set_output_gain(ALL_OUTPUTS, (data >> 8)/255.0f);
- break;
- case 4:
- m_dac5->set_output_gain(ALL_OUTPUTS, (data >> 8)/255.0f);
- break;
- case 5:
- m_dac6->set_output_gain(ALL_OUTPUTS, (data >> 8)/255.0f);
- break;
- case 6:
- m_dac7->set_output_gain(ALL_OUTPUTS, (data >> 8)/255.0f);
- break;
- case 7:
- m_dac8->set_output_gain(ALL_OUTPUTS, (data >> 8)/255.0f);
- break;
+ case 0:
+ m_dac1vol->write(data >> 8);
+ break;
+ case 1:
+ m_dac2vol->write(data >> 8);
+ break;
+ case 2:
+ m_dac3vol->write(data >> 8);
+ break;
+ case 3:
+ m_dac4vol->write(data >> 8);
+ break;
+ case 4:
+ m_dac5vol->write(data >> 8);
+ break;
+ case 5:
+ m_dac6vol->write(data >> 8);
+ break;
+ case 6:
+ m_dac7vol->write(data >> 8);
+ break;
+ case 7:
+ m_dac8vol->write(data >> 8);
+ break;
}
-
+ }
}
@@ -633,67 +661,62 @@ WRITE16_MEMBER( redline_80186_sound_device::redline_dac_w )
WRITE16_MEMBER( leland_80186_sound_device::ataxx_dac_control )
{
- /* handle common offsets */
- switch (offset)
+ if (ACCESSING_BITS_0_7)
{
+ /* handle common offsets */
+ switch (offset)
+ {
case 0x00:
case 0x01:
case 0x02:
- if (ACCESSING_BITS_0_7)
- dac_w(space, offset, data, 0x00ff);
+ dac_w(space, offset, data, 0x00ff);
return;
-
case 0x03:
- if(ACCESSING_BITS_0_7)
- {
- m_dac1->set_output_gain(ALL_OUTPUTS, (((data & 7) * 0x49) >> 1) / 255.0f);
- m_dac2->set_output_gain(ALL_OUTPUTS, ((((data >> 3) & 7) * 0x49) >> 1) / 255.0f);
- m_dac3->set_output_gain(ALL_OUTPUTS, (((data >> 6) & 3) * 0x55) / 255.0f);
- }
- return;
-
- case 0x21:
- if (ACCESSING_BITS_0_7)
- dac_w(space, 1, data, mem_mask);
+ m_dac1vol->write((data & 7) << 5);
+ m_dac2vol->write(((data >> 3) & 7) << 5);
+ m_dac3vol->write(((data >> 6) & 3) << 6);
return;
-
- default:
- break;
+ }
}
/* if we have a YM2151 (and an external DAC), handle those offsets */
- if (m_type == TYPE_WSF)
+ switch (m_type)
{
+ case TYPE_WSF:
+ switch (offset)
+ {
+ case 0x04:
+ m_ext_active = 1;
+ if (LOG_EXTERN) logerror("External DAC active\n");
+ return;
+ case 0x05:
+ m_ext_active = 0;
+ if (LOG_EXTERN) logerror("External DAC inactive\n");
+ return;
+ case 0x06:
+ m_ext_start >>= 4;
+ COMBINE_DATA(&m_ext_start);
+ m_ext_start <<= 4;
+ if (LOG_EXTERN) logerror("External DAC start = %05X\n", m_ext_start);
+ return;
+ case 0x07:
+ m_ext_stop >>= 4;
+ COMBINE_DATA(&m_ext_stop);
+ m_ext_stop <<= 4;
+ if (LOG_EXTERN) logerror("External DAC stop = %05X\n", m_ext_stop);
+ return;
+ }
+ break;
+ default:
switch (offset)
{
- case 0x04:
- m_ext_active = 1;
- if (LOG_EXTERN) logerror("External DAC active\n");
- return;
-
- case 0x05:
- m_ext_active = 0;
- if (LOG_EXTERN) logerror("External DAC inactive\n");
- return;
-
- case 0x06:
- m_ext_start >>= 4;
- COMBINE_DATA(&m_ext_start);
- m_ext_start <<= 4;
- if (LOG_EXTERN) logerror("External DAC start = %05X\n", m_ext_start);
- return;
-
- case 0x07:
- m_ext_stop >>= 4;
- COMBINE_DATA(&m_ext_stop);
- m_ext_stop <<= 4;
- if (LOG_EXTERN) logerror("External DAC stop = %05X\n", m_ext_stop);
- return;
-
- default:
- break;
+ case 0x21:
+ dac_w(space, 3, data, mem_mask);
+ return;
}
+ break;
}
+
logerror("%05X:Unexpected peripheral write %d/%02X = %02X\n", m_audiocpu->device_t::safe_pc(), 5, offset, data);
}
@@ -717,7 +740,7 @@ READ16_MEMBER( leland_80186_sound_device::peripheral_r )
//if ((++m_clock_tick & 7) == 0)
// return 0;
- /* if we've filled up all the active channels, we can give this CPU a reset */
+ /* if we've filled up all the active channels, we can give this CPU a rest */
/* until the next interrupt */
if (m_type != TYPE_REDLINE)
return ((m_clock_active >> 1) & 0x3e);
@@ -725,17 +748,18 @@ READ16_MEMBER( leland_80186_sound_device::peripheral_r )
return ((m_clock_active << 1) & 0x7e);
case 1:
- return main_to_sound_comm_r(space, offset, mem_mask);
+ if (LOG_COMM) logerror("%05X:Read sound command latch = %02X\n", m_audiocpu->device_t::safe_pc(), m_sound_command);
+ return m_sound_command;
case 2:
- if (mem_mask != 0xff00)
+ if (ACCESSING_BITS_0_7)
return m_pit0->read(space, offset & 3);
break;
case 3:
if (m_type <= TYPE_REDLINE)
{
- if (mem_mask != 0xff00)
+ if (ACCESSING_BITS_0_7)
return m_pit1->read(space, offset & 3);
}
else if (m_type == TYPE_WSF)
@@ -745,7 +769,7 @@ READ16_MEMBER( leland_80186_sound_device::peripheral_r )
case 4:
if (m_type == TYPE_REDLINE)
{
- if (mem_mask != 0xff00)
+ if (ACCESSING_BITS_0_7)
return m_pit2->read(space, offset & 3);
}
else
@@ -768,18 +792,19 @@ WRITE16_MEMBER( leland_80186_sound_device::peripheral_w )
switch (select)
{
case 1:
- sound_to_main_comm_w(space, offset, data, mem_mask);
+ if (LOG_COMM) logerror("%05X:Write sound response latch = %02X\n", m_audiocpu->device_t::safe_pc(), data);
+ m_sound_response = data;
break;
case 2:
- if (mem_mask != 0xff00)
+ if (ACCESSING_BITS_0_7)
m_pit0->write(space, offset & 3, data);
break;
case 3:
if (m_type <= TYPE_REDLINE)
{
- if (mem_mask != 0xff00)
+ if (ACCESSING_BITS_0_7)
m_pit1->write(space, offset & 3, data);
}
else if(m_type == TYPE_WSF)
@@ -789,13 +814,13 @@ WRITE16_MEMBER( leland_80186_sound_device::peripheral_w )
case 4:
if (m_type == TYPE_REDLINE)
{
- if (mem_mask != 0xff00)
+ if (ACCESSING_BITS_0_7)
m_pit2->write(space, offset & 3, data);
}
else if (mem_mask == 0xffff)
{
- m_dac7->write_signed16(data << 6);
- m_clock_active &= ~(1<<6);
+ m_dac9->write(data);
+ set_clock_line(6, 0);
}
break;
diff --git a/src/mame/audio/m72.cpp b/src/mame/audio/m72.cpp
index 9c539ad59cc..883fed63576 100644
--- a/src/mame/audio/m72.cpp
+++ b/src/mame/audio/m72.cpp
@@ -55,6 +55,7 @@ m72_audio_device::m72_audio_device(const machine_config &mconfig, const char *ta
, m_sample_addr(0)
, m_samples(*this, "^samples")
, m_samples_size(0)
+ , m_dac(*this, "^dac")
, m_soundlatch(*this, "^soundlatch")
{
}
@@ -77,7 +78,6 @@ void m72_audio_device::device_start()
{
m_samples_size = m_samples.bytes();
m_space = &machine().device("soundcpu")->memory().space(AS_IO);
- m_dac = machine().device<dac_device>("dac");
save_item(NAME(m_irqvector));
save_item(NAME(m_sample_addr));
@@ -216,7 +216,7 @@ READ8_MEMBER( m72_audio_device::sample_r )
WRITE8_MEMBER( m72_audio_device::sample_w )
{
- m_dac->write_signed8(data);
+ m_dac->write(data);
m_sample_addr = (m_sample_addr + 1) & (m_samples_size - 1);
}
diff --git a/src/mame/audio/m72.h b/src/mame/audio/m72.h
index 3ac86396e3a..9e6c241206c 100644
--- a/src/mame/audio/m72.h
+++ b/src/mame/audio/m72.h
@@ -55,7 +55,7 @@ private:
optional_region_ptr<UINT8> m_samples;
UINT32 m_samples_size;
address_space *m_space;
- dac_device *m_dac;
+ optional_device<dac_byte_interface> m_dac;
required_device<generic_latch_8_device> m_soundlatch;
TIMER_CALLBACK_MEMBER( setvector_callback );
diff --git a/src/mame/audio/meadows.cpp b/src/mame/audio/meadows.cpp
index 48836a9975c..d4a72a027ad 100644
--- a/src/mame/audio/meadows.cpp
+++ b/src/mame/audio/meadows.cpp
@@ -12,7 +12,6 @@
#include "cpu/s2650/s2650.h"
#include "includes/meadows.h"
#include "sound/samples.h"
-#include "sound/dac.h"
@@ -33,8 +32,6 @@ static const INT16 waveform[2] = { -120*256, 120*256 };
SAMPLES_START_CB_MEMBER(meadows_state::meadows_sh_start)
{
m_0c00 = m_0c01 = m_0c02 = m_0c03 = 0;
- m_dac_data = 0;
- m_dac_enable = 0;
m_channel = 0;
m_freq1 = m_freq2 = 1000;
m_latched_0c01 = m_latched_0c02 = m_latched_0c03 = 0;
@@ -88,29 +85,12 @@ void meadows_state::meadows_sh_update()
m_samples->set_volume(1,amp/255.0);
}
- if (m_latched_0c03 != m_0c03)
+ if (((m_latched_0c03 ^ m_0c03) & ENABLE_DAC) != 0)
{
- m_dac_enable = m_0c03 & ENABLE_DAC;
-
- if (m_dac_enable)
- m_dac->write_unsigned8(m_dac_data);
- else
- m_dac->write_unsigned8(0);
+ m_dac->set_output_gain(ALL_OUTPUTS, (m_0c03 & ENABLE_DAC) != 0 ? 1.0 : 0.0);
}
m_latched_0c01 = m_0c01;
m_latched_0c02 = m_0c02;
m_latched_0c03 = m_0c03;
}
-
-/************************************/
-/* Write DAC value */
-/************************************/
-void meadows_state::meadows_sh_dac_w(int data)
-{
- m_dac_data = data;
- if (m_dac_enable)
- m_dac->write_unsigned8(m_dac_data);
- else
- m_dac->write_unsigned8(0);
-}
diff --git a/src/mame/audio/midway.cpp b/src/mame/audio/midway.cpp
index 6b9167bc5b2..5a9fbe6f802 100644
--- a/src/mame/audio/midway.cpp
+++ b/src/mame/audio/midway.cpp
@@ -9,9 +9,10 @@
***************************************************************************/
#include "emu.h"
-#include "audio/williams.h"
#include "includes/mcr.h"
#include "audio/midway.h"
+#include "audio/williams.h"
+#include "sound/volt_reg.h"
@@ -539,8 +540,8 @@ WRITE_LINE_MEMBER(midway_chip_squeak_deluxe_device::reset_write)
WRITE8_MEMBER(midway_chip_squeak_deluxe_device::porta_w)
{
- m_dacval = (m_dacval & ~0x3fc) | (data << 2);
- m_dac->write_signed16(m_dacval << 6);
+ m_dacval = (data << 2) | (m_dacval & 3);
+ m_dac->write(m_dacval);
}
@@ -550,8 +551,8 @@ WRITE8_MEMBER(midway_chip_squeak_deluxe_device::porta_w)
WRITE8_MEMBER(midway_chip_squeak_deluxe_device::portb_w)
{
- m_dacval = (m_dacval & ~0x003) | (data >> 6);
- m_dac->write_signed16(m_dacval << 6);
+ m_dacval = (m_dacval & ~3) | (data >> 6);
+ m_dac->write(m_dacval);
UINT8 z_mask = m_pia->port_b_z_mask();
if (~z_mask & 0x10) m_status = (m_status & ~1) | ((data >> 4) & 1);
@@ -628,8 +629,9 @@ static MACHINE_CONFIG_FRAGMENT(midway_chip_squeak_deluxe)
MCFG_PIA_IRQA_HANDLER(WRITELINE(midway_chip_squeak_deluxe_device, irq_w))
MCFG_PIA_IRQB_HANDLER(WRITELINE(midway_chip_squeak_deluxe_device, irq_w))
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 1.0)
+ MCFG_SOUND_ADD("dac", DAC_10BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 1.0) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
@@ -738,8 +740,8 @@ WRITE_LINE_MEMBER(midway_sounds_good_device::reset_write)
WRITE8_MEMBER(midway_sounds_good_device::porta_w)
{
- m_dacval = (m_dacval & ~0x3fc) | (data << 2);
- m_dac->write_signed16(m_dacval << 6);
+ m_dacval = (data << 2) | (m_dacval & 3);
+ m_dac->write(m_dacval);
}
@@ -751,8 +753,8 @@ WRITE8_MEMBER(midway_sounds_good_device::portb_w)
{
UINT8 z_mask = m_pia->port_b_z_mask();
- m_dacval = (m_dacval & ~0x003) | (data >> 6);
- m_dac->write_signed16(m_dacval << 6);
+ m_dacval = (m_dacval & ~3) | (data >> 6);
+ m_dac->write(m_dacval);
if (~z_mask & 0x10) m_status = (m_status & ~1) | ((data >> 4) & 1);
if (~z_mask & 0x20) m_status = (m_status & ~2) | ((data >> 4) & 2);
@@ -798,8 +800,9 @@ static MACHINE_CONFIG_FRAGMENT(midway_sounds_good)
MCFG_PIA_IRQA_HANDLER(WRITELINE(midway_sounds_good_device, irq_w))
MCFG_PIA_IRQB_HANDLER(WRITELINE(midway_sounds_good_device, irq_w))
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 1.0)
+ MCFG_SOUND_ADD("dac", AD7533, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 1.0) /// ad7533jn.u10
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
@@ -907,8 +910,8 @@ WRITE_LINE_MEMBER(midway_turbo_chip_squeak_device::reset_write)
WRITE8_MEMBER(midway_turbo_chip_squeak_device::porta_w)
{
- m_dacval = (m_dacval & ~0x3fc) | (data << 2);
- m_dac->write_signed16(m_dacval << 6);
+ m_dacval = (data << 2) | (m_dacval & 3);
+ m_dac->write(m_dacval);
}
@@ -918,8 +921,8 @@ WRITE8_MEMBER(midway_turbo_chip_squeak_device::porta_w)
WRITE8_MEMBER(midway_turbo_chip_squeak_device::portb_w)
{
- m_dacval = (m_dacval & ~0x003) | (data >> 6);
- m_dac->write_signed16(m_dacval << 6);
+ m_dacval = (m_dacval & ~3) | (data >> 6);
+ m_dac->write(m_dacval);
m_status = (data >> 4) & 3;
}
@@ -962,8 +965,9 @@ static MACHINE_CONFIG_FRAGMENT(midway_turbo_chip_squeak)
MCFG_PIA_IRQA_HANDLER(WRITELINE(midway_turbo_chip_squeak_device, irq_w))
MCFG_PIA_IRQB_HANDLER(WRITELINE(midway_turbo_chip_squeak_device, irq_w))
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 1.0)
+ MCFG_SOUND_ADD("dac", DAC_10BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 1.0) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
diff --git a/src/mame/audio/midway.h b/src/mame/audio/midway.h
index 60cc5571cf0..b6956b99b82 100644
--- a/src/mame/audio/midway.h
+++ b/src/mame/audio/midway.h
@@ -36,22 +36,6 @@ extern const device_type MIDWAY_SQUAWK_N_TALK;
//**************************************************************************
-// DEVICE CONFIGURATION MACROS
-//**************************************************************************
-
-#define MCFG_MIDWAY_SSIO_ADD(_tag) \
- MCFG_DEVICE_ADD(_tag, MIDWAY_SSIO, 0)
-#define MCFG_MIDWAY_CHIP_SQUEAK_DELUXE_ADD(_tag) \
- MCFG_DEVICE_ADD(_tag, MIDWAY_CHIP_SQUEAK_DELUXE, 0)
-#define MCFG_MIDWAY_SOUNDS_GOOD_ADD(_tag) \
- MCFG_DEVICE_ADD(_tag, MIDWAY_SOUNDS_GOOD, 0)
-#define MCFG_MIDWAY_TURBO_CHIP_SQUEAK_ADD(_tag) \
- MCFG_DEVICE_ADD(_tag, MIDWAY_TURBO_CHIP_SQUEAK, 0)
-#define MCFG_MIDWAY_SQUAWK_N_TALK_ADD(_tag) \
- MCFG_DEVICE_ADD(_tag, MIDWAY_SQUAWK_N_TALK, 0)
-
-
-//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
@@ -156,7 +140,7 @@ private:
// devices
required_device<m68000_device> m_cpu;
required_device<pia6821_device> m_pia;
- required_device<dac_device> m_dac;
+ required_device<dac_word_interface> m_dac;
// internal state
UINT8 m_status;
@@ -194,7 +178,7 @@ private:
// devices
required_device<m68000_device> m_cpu;
required_device<pia6821_device> m_pia;
- required_device<dac_device> m_dac;
+ required_device<dac_word_interface> m_dac;
// internal state
UINT8 m_status;
@@ -232,7 +216,7 @@ private:
// devices
required_device<m6809e_device> m_cpu;
required_device<pia6821_device> m_pia;
- required_device<dac_device> m_dac;
+ required_device<dac_word_interface> m_dac;
// internal state
UINT8 m_status;
diff --git a/src/mame/audio/n8080.cpp b/src/mame/audio/n8080.cpp
index 7cbab15d9a8..b4b094c6c2c 100644
--- a/src/mame/audio/n8080.cpp
+++ b/src/mame/audio/n8080.cpp
@@ -8,6 +8,7 @@
#include "emu.h"
#include "includes/n8080.h"
+#include "sound/volt_reg.h"
static const double ATTACK_RATE = 10e-6 * 500;
static const double DECAY_RATE = 10e-6 * 16000;
@@ -324,13 +325,7 @@ READ8_MEMBER(n8080_state::helifire_8035_p2_r)
WRITE8_MEMBER(n8080_state::n8080_dac_w)
{
- m_dac->write_unsigned8(data & 0x80);
-}
-
-
-WRITE8_MEMBER(n8080_state::helifire_dac_w)
-{
- m_dac->write_unsigned8(data * m_helifire_dac_volume);
+ m_n8080_dac->write(BIT(data, 7));
}
@@ -379,6 +374,8 @@ TIMER_DEVICE_CALLBACK_MEMBER(n8080_state::helifire_dac_volume_timer)
{
m_helifire_dac_volume = exp(t / DECAY_RATE);
}
+
+ m_helifire_dac->set_output_gain(ALL_OUTPUTS, m_helifire_dac_volume);
}
@@ -487,7 +484,7 @@ static ADDRESS_MAP_START( helifire_sound_io_map, AS_IO, 8, n8080_state )
AM_RANGE(0x00, 0x7f) AM_READ(helifire_8035_external_ram_r)
- AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_WRITE(helifire_dac_w)
+ AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_DEVWRITE("helifire_dac", dac_byte_interface, write)
AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_WRITE(helifire_sound_ctrl_w)
ADDRESS_MAP_END
@@ -505,10 +502,11 @@ MACHINE_CONFIG_FRAGMENT( spacefev_sound )
MCFG_TIMER_DRIVER_ADD_PERIODIC("vco_timer", n8080_state, spacefev_vco_voltage_timer, attotime::from_hz(1000))
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
+ MCFG_SOUND_ADD("n8080_dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.15)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "n8080_dac", 1.0, DAC_VREF_POS_INPUT)
MCFG_SOUND_ADD("snsnd", SN76477, 0)
MCFG_SN76477_NOISE_PARAMS(RES_K(36), RES_K(150), CAP_N(1)) // noise + filter
@@ -524,7 +522,7 @@ MACHINE_CONFIG_FRAGMENT( spacefev_sound )
MCFG_SN76477_MIXER_PARAMS(0, 0, 0) // mixer A, B, C
MCFG_SN76477_ENVELOPE_PARAMS(1, 0) // envelope 1, 2
MCFG_SN76477_ENABLE(1) // enable
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.35)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.35)
MACHINE_CONFIG_END
@@ -539,10 +537,11 @@ MACHINE_CONFIG_FRAGMENT( sheriff_sound )
MCFG_CPU_IO_MAP(n8080_sound_io_map)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
+ MCFG_SOUND_ADD("n8080_dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.15)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "n8080_dac", 1.0, DAC_VREF_POS_INPUT)
MCFG_SOUND_ADD("snsnd", SN76477, 0)
MCFG_SN76477_NOISE_PARAMS(RES_K(36), RES_K(100), CAP_N(1)) // noise + filter
@@ -558,7 +557,7 @@ MACHINE_CONFIG_FRAGMENT( sheriff_sound )
MCFG_SN76477_MIXER_PARAMS(0, 0, 0) // mixer A, B, C
MCFG_SN76477_ENVELOPE_PARAMS(1, 0) // envelope 1, 2
MCFG_SN76477_ENABLE(1) // enable
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.35)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.35)
MACHINE_CONFIG_END
@@ -572,11 +571,11 @@ MACHINE_CONFIG_FRAGMENT( helifire_sound )
MCFG_CPU_PROGRAM_MAP(n8080_sound_cpu_map)
MCFG_CPU_IO_MAP(helifire_sound_io_map)
- MCFG_TIMER_DRIVER_ADD_PERIODIC("helifire_dac", n8080_state, helifire_dac_volume_timer, attotime::from_hz(1000))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("helifire_dac_volume_timer", n8080_state, helifire_dac_volume_timer, attotime::from_hz(1000))
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
-
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("helifire_dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.15) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "helifire_dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "helifire_dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
diff --git a/src/mame/audio/s11c_bg.cpp b/src/mame/audio/s11c_bg.cpp
index fc45e1b222e..a700e188aa2 100644
--- a/src/mame/audio/s11c_bg.cpp
+++ b/src/mame/audio/s11c_bg.cpp
@@ -8,18 +8,20 @@
*/
#include "s11c_bg.h"
+#include "sound/dac.h"
+#include "sound/volt_reg.h"
const device_type S11C_BG = &device_creator<s11c_bg_device>;
s11c_bg_device::s11c_bg_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig,S11C_BG,"Williams System 11C Background Music",tag,owner,clock, "s11c_bg", __FILE__),
- m_cpu(*this,"bgcpu"),
- m_ym2151(*this,"ym2151"),
- m_hc55516(*this,"hc55516_bg"),
- m_dac1(*this,"dac1"),
- m_pia40(*this,"pia40"),
- m_cpubank(*this,"bgbank")
+ device_mixer_interface(mconfig, *this),
+ m_cpu(*this,"bgcpu"),
+ m_ym2151(*this,"ym2151"),
+ m_hc55516(*this,"hc55516_bg"),
+ m_pia40(*this,"pia40"),
+ m_cpubank(*this,"bgbank")
{
}
@@ -33,11 +35,6 @@ static ADDRESS_MAP_START( s11c_bg_map, AS_PROGRAM, 8, s11c_bg_device )
AM_RANGE(0x8000, 0xffff) AM_ROMBANK("bgbank")
ADDRESS_MAP_END
-WRITE8_MEMBER( s11c_bg_device::pia40_pa_w )
-{
- m_dac1->write_unsigned8(data);
-}
-
WRITE_LINE_MEMBER( s11c_bg_device::pia40_cb2_w)
{
// m_pia34->cb1_w(state); // To Widget MCB1 through CPU Data interface
@@ -69,19 +66,19 @@ MACHINE_CONFIG_FRAGMENT( s11c_bg )
MCFG_CPU_PROGRAM_MAP(s11c_bg_map)
MCFG_QUANTUM_TIME(attotime::from_hz(50))
- MCFG_SPEAKER_STANDARD_MONO("bg")
MCFG_YM2151_ADD("ym2151", 3580000)
MCFG_YM2151_IRQ_HANDLER(WRITELINE(s11c_bg_device, ym2151_irq_w))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "bg", 0.25)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.25)
- MCFG_DAC_ADD("dac1")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "bg", 0.50)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.25) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MCFG_SOUND_ADD("hc55516_bg", HC55516, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "bg", 0.50)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.5)
MCFG_DEVICE_ADD("pia40", PIA6821, 0)
- MCFG_PIA_WRITEPA_HANDLER(WRITE8(s11c_bg_device, pia40_pa_w))
+ MCFG_PIA_WRITEPA_HANDLER(DEVWRITE8("dac", dac_byte_interface, write))
MCFG_PIA_WRITEPB_HANDLER(WRITE8(s11c_bg_device, pia40_pb_w))
MCFG_PIA_CA2_HANDLER(WRITELINE(s11c_bg_device, pia40_ca2_w))
MCFG_PIA_CB2_HANDLER(WRITELINE(s11c_bg_device, pia40_cb2_w))
@@ -110,7 +107,7 @@ void s11c_bg_device::device_reset()
m_cpu->set_input_line(INPUT_LINE_RESET,PULSE_LINE);
}
-void s11c_bg_device::static_set_gfxregion(device_t &device, const char *tag)
+void s11c_bg_device::static_set_romregion(device_t &device, const char *tag)
{
s11c_bg_device &cpuboard = downcast<s11c_bg_device &>(device);
cpuboard.m_regiontag = tag;
diff --git a/src/mame/audio/s11c_bg.h b/src/mame/audio/s11c_bg.h
index 55d4b853f47..211a88c23e5 100644
--- a/src/mame/audio/s11c_bg.h
+++ b/src/mame/audio/s11c_bg.h
@@ -12,16 +12,16 @@
#include "emu.h"
#include "cpu/m6809/m6809.h"
#include "sound/ym2151.h"
-#include "sound/dac.h"
#include "sound/hc55516.h"
#include "machine/6821pia.h"
-#define MCFG_WMS_S11C_BG_ADD(_tag, _region) \
- MCFG_DEVICE_ADD(_tag, S11C_BG, 0) \
- s11c_bg_device::static_set_gfxregion(*device, _region);
+#define MCFG_S11C_BG_ROM_REGION(_region) \
+ s11c_bg_device::static_set_romregion(*device, _region);
-class s11c_bg_device : public device_t
+
+class s11c_bg_device : public device_t,
+ public device_mixer_interface
{
public:
// construction/destruction
@@ -30,12 +30,10 @@ public:
required_device<cpu_device> m_cpu;
required_device<ym2151_device> m_ym2151;
required_device<hc55516_device> m_hc55516;
- required_device<dac_device> m_dac1;
required_device<pia6821_device> m_pia40;
required_memory_bank m_cpubank;
memory_region* m_rom;
- DECLARE_WRITE8_MEMBER(pia40_pa_w);
DECLARE_WRITE8_MEMBER(pia40_pb_w);
DECLARE_WRITE_LINE_MEMBER(pia40_ca2_w);
DECLARE_WRITE_LINE_MEMBER(pia40_cb2_w);
@@ -46,7 +44,7 @@ public:
void ctrl_w(UINT8 data);
void data_w(UINT8 data);
- static void static_set_gfxregion(device_t &device, const char *tag);
+ static void static_set_romregion(device_t &device, const char *tag);
protected:
// overrides
@@ -56,7 +54,6 @@ protected:
private:
const char* m_regiontag;
-
};
extern const device_type S11C_BG;
diff --git a/src/mame/audio/segag80r.cpp b/src/mame/audio/segag80r.cpp
index 60cdcc7a93a..05680d2adb8 100644
--- a/src/mame/audio/segag80r.cpp
+++ b/src/mame/audio/segag80r.cpp
@@ -17,6 +17,7 @@
#include "sound/samples.h"
#include "sound/tms36xx.h"
#include "sound/dac.h"
+#include "sound/volt_reg.h"
/*************************************
@@ -245,7 +246,7 @@ MACHINE_CONFIG_FRAGMENT( astrob_sound_board )
MCFG_SOUND_ADD("samples", SAMPLES, 0)
MCFG_SAMPLES_CHANNELS(11)
MCFG_SAMPLES_NAMES(astrob_sample_names)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
MACHINE_CONFIG_END
@@ -437,10 +438,10 @@ MACHINE_CONFIG_FRAGMENT( 005_sound_board )
MCFG_SOUND_ADD("samples", SAMPLES, 0)
MCFG_SAMPLES_CHANNELS(7)
MCFG_SAMPLES_NAMES(sega005_sample_names)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
MCFG_SOUND_ADD("005", SEGA005, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
MACHINE_CONFIG_END
@@ -595,7 +596,7 @@ MACHINE_CONFIG_FRAGMENT( spaceod_sound_board )
MCFG_SOUND_ADD("samples", SAMPLES, 0)
MCFG_SAMPLES_CHANNELS(11)
MCFG_SAMPLES_NAMES(spaceod_sample_names)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
MACHINE_CONFIG_END
@@ -690,7 +691,7 @@ static ADDRESS_MAP_START( monsterb_7751_portmap, AS_IO, 8, segag80r_state )
AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_READ(n7751_t1_r)
AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_READ(n7751_command_r)
AM_RANGE(MCS48_PORT_BUS, MCS48_PORT_BUS) AM_READ(n7751_rom_r)
- AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_DEVWRITE("dac", dac_device, write_unsigned8)
+ AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_WRITE(n7751_p2_w)
AM_RANGE(MCS48_PORT_PROG, MCS48_PORT_PROG) AM_DEVWRITE("audio_8243", i8243_device, i8243_prog_w)
ADDRESS_MAP_END
@@ -721,15 +722,16 @@ MACHINE_CONFIG_FRAGMENT( monsterb_sound_board )
MCFG_SOUND_ADD("samples", SAMPLES, 0)
MCFG_SAMPLES_CHANNELS(2)
MCFG_SAMPLES_NAMES(monsterb_sample_names)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
MCFG_TMS36XX_ADD("music", 247)
MCFG_TMS36XX_TYPE(TMS3617)
MCFG_TMS36XX_DECAY_TIMES(0.5, 0.5, 0.5, 0.5, 0.5, 0.5)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
diff --git a/src/mame/audio/segasnd.cpp b/src/mame/audio/segasnd.cpp
index abc5df498d4..2fca18abd9b 100644
--- a/src/mame/audio/segasnd.cpp
+++ b/src/mame/audio/segasnd.cpp
@@ -228,7 +228,7 @@ MACHINE_CONFIG_FRAGMENT( sega_speech_board )
MCFG_SOUND_ADD("segaspeech", SEGASPEECH, 0)
MCFG_SOUND_ADD("speech", SP0250, SPEECH_MASTER_CLOCK)
MCFG_SP0250_DRQ_CALLBACK(DEVWRITELINE("segaspeech", speech_sound_device, drq_w))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/audio/segasnd.h b/src/mame/audio/segasnd.h
index 8436d8427e7..be4386d2ac7 100644
--- a/src/mame/audio/segasnd.h
+++ b/src/mame/audio/segasnd.h
@@ -188,8 +188,8 @@ extern const device_type SEGAUSBROM;
#define MCFG_SEGAUSB_ADD(_tag) \
MCFG_SOUND_ADD(_tag, SEGAUSB, 0) \
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
#define MCFG_SEGAUSBROM_ADD(_tag) \
MCFG_SOUND_ADD(_tag, SEGAUSBROM, 0) \
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
diff --git a/src/mame/audio/senjyo.cpp b/src/mame/audio/senjyo.cpp
index 1b0c938a295..3367a8b3b6e 100644
--- a/src/mame/audio/senjyo.cpp
+++ b/src/mame/audio/senjyo.cpp
@@ -23,7 +23,7 @@ WRITE_LINE_MEMBER(senjyo_state::sound_line_clock)
{
if (state != 0)
{
- m_dac->write_signed16(2184 * 2 * ((m_sound_state & 8) ? m_single_volume : 0));
+ m_dac->write((m_sound_state & 8) ? m_single_volume : 0);
m_sound_state++;
}
}
diff --git a/src/mame/audio/spacefb.cpp b/src/mame/audio/spacefb.cpp
index 9e846d04904..7f9cd3767e9 100644
--- a/src/mame/audio/spacefb.cpp
+++ b/src/mame/audio/spacefb.cpp
@@ -7,10 +7,11 @@
****************************************************************************/
#include "emu.h"
+#include "includes/spacefb.h"
#include "cpu/mcs48/mcs48.h"
#include "sound/dac.h"
#include "sound/samples.h"
-#include "includes/spacefb.h"
+#include "sound/volt_reg.h"
READ8_MEMBER(spacefb_state::audio_p2_r)
@@ -75,13 +76,13 @@ static const char *const spacefb_sample_names[] =
MACHINE_CONFIG_FRAGMENT( spacefb_audio )
- MCFG_SPEAKER_STANDARD_MONO("mono")
-
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MCFG_SOUND_ADD("samples", SAMPLES, 0)
MCFG_SAMPLES_CHANNELS(3)
MCFG_SAMPLES_NAMES(spacefb_sample_names)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/audio/targ.cpp b/src/mame/audio/targ.cpp
index 440678e1113..8c3fed212f0 100644
--- a/src/mame/audio/targ.cpp
+++ b/src/mame/audio/targ.cpp
@@ -15,6 +15,7 @@
#include "emu.h"
#include "includes/exidy.h"
+#include "sound/volt_reg.h"
@@ -56,8 +57,8 @@ void exidy_state::adjust_sample(UINT8 freq)
WRITE8_MEMBER( exidy_state::targ_audio_1_w )
{
/* CPU music */
- if ((data & 0x01) != (m_port_1_last & 0x01))
- m_dac->write_unsigned8((data & 0x01) * 0xff);
+ if (BIT(m_port_1_last ^ data, 0))
+ m_dac->write(BIT(data, 0));
/* shot */
if (FALLING_EDGE(0x02) && !m_samples->playing(0)) m_samples->start(0,1);
@@ -175,29 +176,31 @@ SAMPLES_START_CB_MEMBER(exidy_state::targ_audio_start)
MACHINE_CONFIG_FRAGMENT( spectar_audio )
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_SOUND_ADD("samples", SAMPLES, 0)
MCFG_SAMPLES_CHANNELS(4)
MCFG_SAMPLES_NAMES(sample_names)
MCFG_SAMPLES_START_CB(exidy_state, spectar_audio_start)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.99)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT)
MACHINE_CONFIG_END
MACHINE_CONFIG_FRAGMENT( targ_audio )
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_SOUND_ADD("samples", SAMPLES, 0)
MCFG_SAMPLES_CHANNELS(4)
MCFG_SAMPLES_NAMES(sample_names)
MCFG_SAMPLES_START_CB(exidy_state, targ_audio_start)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.99)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT)
MACHINE_CONFIG_END
diff --git a/src/mame/audio/williams.cpp b/src/mame/audio/williams.cpp
index 78172f3251d..f5a5aca24a2 100644
--- a/src/mame/audio/williams.cpp
+++ b/src/mame/audio/williams.cpp
@@ -31,13 +31,14 @@
****************************************************************************/
#include "emu.h"
+#include "williams.h"
#include "machine/6821pia.h"
#include "cpu/m6809/m6809.h"
-#include "williams.h"
#include "sound/ym2151.h"
#include "sound/okim6295.h"
#include "sound/hc55516.h"
#include "sound/dac.h"
+#include "sound/volt_reg.h"
#define NARC_MASTER_CLOCK XTAL_8MHz
@@ -211,7 +212,7 @@ static MACHINE_CONFIG_FRAGMENT( williams_cvsd_sound )
MCFG_CPU_PROGRAM_MAP(williams_cvsd_map)
MCFG_DEVICE_ADD("pia", PIA6821, 0)
- MCFG_PIA_WRITEPA_HANDLER(DEVWRITE8("dac", dac_device, write_unsigned8))
+ MCFG_PIA_WRITEPA_HANDLER(DEVWRITE8("dac", dac_byte_interface, write))
MCFG_PIA_WRITEPB_HANDLER(WRITE8(williams_cvsd_sound_device, talkback_w))
MCFG_PIA_IRQA_HANDLER(WRITELINE(williams_cvsd_sound_device, pia_irqa))
MCFG_PIA_IRQB_HANDLER(WRITELINE(williams_cvsd_sound_device, pia_irqb))
@@ -220,8 +221,9 @@ static MACHINE_CONFIG_FRAGMENT( williams_cvsd_sound )
MCFG_YM2151_IRQ_HANDLER(WRITELINE(williams_cvsd_sound_device, ym2151_irq_w))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.10)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.50)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.25) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MCFG_SOUND_ADD("cvsd", HC55516, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.60)
@@ -513,7 +515,7 @@ static ADDRESS_MAP_START( williams_narc_master_map, AS_PROGRAM, 8, williams_narc
AM_RANGE(0x2000, 0x2001) AM_MIRROR(0x03fe) AM_DEVREADWRITE("ym2151", ym2151_device, read, write)
AM_RANGE(0x2800, 0x2800) AM_MIRROR(0x03ff) AM_WRITE(master_talkback_w)
AM_RANGE(0x2c00, 0x2c00) AM_MIRROR(0x03ff) AM_WRITE(command2_w)
- AM_RANGE(0x3000, 0x3000) AM_MIRROR(0x03ff) AM_DEVWRITE("dac1", dac_device, write_unsigned8)
+ AM_RANGE(0x3000, 0x3000) AM_MIRROR(0x03ff) AM_DEVWRITE("dac1", dac_byte_interface, write)
AM_RANGE(0x3400, 0x3400) AM_MIRROR(0x03ff) AM_READ(command_r)
AM_RANGE(0x3800, 0x3800) AM_MIRROR(0x03ff) AM_WRITE(master_bank_select_w)
AM_RANGE(0x3c00, 0x3c00) AM_MIRROR(0x03ff) AM_WRITE(master_sync_w)
@@ -531,7 +533,7 @@ static ADDRESS_MAP_START( williams_narc_slave_map, AS_PROGRAM, 8, williams_narc_
AM_RANGE(0x2000, 0x2000) AM_MIRROR(0x03ff) AM_WRITE(cvsd_clock_set_w)
AM_RANGE(0x2400, 0x2400) AM_MIRROR(0x03ff) AM_WRITE(cvsd_digit_clock_clear_w)
AM_RANGE(0x2800, 0x2800) AM_MIRROR(0x03ff) AM_WRITE(slave_talkback_w)
- AM_RANGE(0x3000, 0x3000) AM_MIRROR(0x03ff) AM_DEVWRITE("dac2", dac_device, write_unsigned8)
+ AM_RANGE(0x3000, 0x3000) AM_MIRROR(0x03ff) AM_DEVWRITE("dac2", dac_byte_interface, write)
AM_RANGE(0x3400, 0x3400) AM_MIRROR(0x03ff) AM_READ(command2_r)
AM_RANGE(0x3800, 0x3800) AM_MIRROR(0x03ff) AM_WRITE(slave_bank_select_w)
AM_RANGE(0x3c00, 0x3c00) AM_MIRROR(0x03ff) AM_WRITE(slave_sync_w)
@@ -555,11 +557,11 @@ static MACHINE_CONFIG_FRAGMENT( williams_narc_sound )
MCFG_YM2151_IRQ_HANDLER(WRITELINE(williams_narc_sound_device, ym2151_irq_w))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.10)
- MCFG_DAC_ADD("dac1")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.50)
-
- MCFG_DAC_ADD("dac2")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.50)
+ MCFG_SOUND_ADD("dac1", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.25) // unknown DAC
+ MCFG_SOUND_ADD("dac2", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.25) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac1", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac1", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac2", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac2", -1.0, DAC_VREF_NEG_INPUT)
MCFG_SOUND_ADD("cvsd", HC55516, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.60)
@@ -794,7 +796,7 @@ static ADDRESS_MAP_START( williams_adpcm_map, AS_PROGRAM, 8, williams_adpcm_soun
AM_RANGE(0x0000, 0x1fff) AM_RAM
AM_RANGE(0x2000, 0x2000) AM_MIRROR(0x03ff) AM_WRITE(bank_select_w)
AM_RANGE(0x2400, 0x2401) AM_MIRROR(0x03fe) AM_DEVREADWRITE("ym2151", ym2151_device, read, write)
- AM_RANGE(0x2800, 0x2800) AM_MIRROR(0x03ff) AM_DEVWRITE("dac", dac_device, write_unsigned8)
+ AM_RANGE(0x2800, 0x2800) AM_MIRROR(0x03ff) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(0x2c00, 0x2c00) AM_MIRROR(0x03ff) AM_DEVREADWRITE("oki", okim6295_device, read, write)
AM_RANGE(0x3000, 0x3000) AM_MIRROR(0x03ff) AM_READ(command_r)
AM_RANGE(0x3400, 0x3400) AM_MIRROR(0x03ff) AM_WRITE(oki6295_bank_select_w)
@@ -826,12 +828,13 @@ static MACHINE_CONFIG_FRAGMENT( williams_adpcm_sound )
MCFG_YM2151_IRQ_HANDLER(WRITELINE(williams_adpcm_sound_device, ym2151_irq_w))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.10)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.50)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.5) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MCFG_OKIM6295_ADD("oki", ADPCM_MASTER_CLOCK/8, OKIM6295_PIN7_HIGH) // clock frequency & pin 7 not verified
MCFG_DEVICE_ADDRESS_MAP(AS_0, williams_adpcm_oki_map)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.50)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.5)
MACHINE_CONFIG_END
diff --git a/src/mame/audio/williams.h b/src/mame/audio/williams.h
index f7217f60bdb..aa0e8019b0a 100644
--- a/src/mame/audio/williams.h
+++ b/src/mame/audio/williams.h
@@ -14,7 +14,6 @@
#include "sound/ym2151.h"
#include "sound/okim6295.h"
#include "sound/hc55516.h"
-#include "sound/dac.h"
@@ -29,18 +28,6 @@ extern const device_type WILLIAMS_ADPCM_SOUND;
//**************************************************************************
-// DEVICE CONFIGURATION MACROS
-//**************************************************************************
-
-#define MCFG_WILLIAMS_NARC_SOUND_ADD(_tag) \
- MCFG_DEVICE_ADD(_tag, WILLIAMS_NARC_SOUND, 0)
-#define MCFG_WILLIAMS_CVSD_SOUND_ADD(_tag) \
- MCFG_DEVICE_ADD(_tag, WILLIAMS_CVSD_SOUND, 0)
-#define MCFG_WILLIAMS_ADPCM_SOUND_ADD(_tag) \
- MCFG_DEVICE_ADD(_tag, WILLIAMS_ADPCM_SOUND, 0)
-
-
-//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
diff --git a/src/mame/audio/wpcsnd.cpp b/src/mame/audio/wpcsnd.cpp
index 66f4208e9d6..bdd5613b707 100644
--- a/src/mame/audio/wpcsnd.cpp
+++ b/src/mame/audio/wpcsnd.cpp
@@ -8,21 +8,23 @@
*/
#include "wpcsnd.h"
+#include "sound/dac.h"
+#include "sound/volt_reg.h"
#define LOG_WPCSND (0)
const device_type WPCSND = &device_creator<wpcsnd_device>;
wpcsnd_device::wpcsnd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : device_t(mconfig,WPCSND,"Williams WPC Sound",tag,owner,clock, "wpcsnd", __FILE__)
- , m_cpu(*this, "bgcpu")
- , m_ym2151(*this, "ym2151")
- , m_hc55516(*this, "hc55516")
- , m_dac(*this, "dac")
- , m_cpubank(*this, "rombank")
- , m_fixedbank(*this, "fixed")
- , m_rom(*this, finder_base::DUMMY_TAG)
- , m_reply_cb(*this)
+ : device_t(mconfig,WPCSND,"Williams WPC Sound",tag,owner,clock, "wpcsnd", __FILE__),
+ device_mixer_interface(mconfig, *this),
+ m_cpu(*this, "bgcpu"),
+ m_ym2151(*this, "ym2151"),
+ m_hc55516(*this, "hc55516"),
+ m_cpubank(*this, "rombank"),
+ m_fixedbank(*this, "fixed"),
+ m_rom(*this, finder_base::DUMMY_TAG),
+ m_reply_cb(*this)
{
}
@@ -30,7 +32,7 @@ static ADDRESS_MAP_START( wpcsnd_map, AS_PROGRAM, 8, wpcsnd_device )
AM_RANGE(0x0000, 0x1fff) AM_RAM
AM_RANGE(0x2000, 0x2000) AM_MIRROR(0x03ff) AM_WRITE(rombank_w)
AM_RANGE(0x2400, 0x2401) AM_MIRROR(0x03fe) AM_DEVREADWRITE("ym2151", ym2151_device, read, write)
- AM_RANGE(0x2800, 0x2800) AM_MIRROR(0x03ff) AM_DEVWRITE("dac", dac_device, write_unsigned8)
+ AM_RANGE(0x2800, 0x2800) AM_MIRROR(0x03ff) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(0x2c00, 0x2fff) AM_WRITE(bg_speech_digit_w)
AM_RANGE(0x3000, 0x33ff) AM_READ(latch_r)
AM_RANGE(0x3400, 0x37ff) AM_WRITE(bg_speech_clock_w)
@@ -68,16 +70,16 @@ MACHINE_CONFIG_FRAGMENT( wpcsnd )
MCFG_CPU_PROGRAM_MAP(wpcsnd_map)
MCFG_QUANTUM_TIME(attotime::from_hz(50))
- MCFG_SPEAKER_STANDARD_MONO("bg")
MCFG_YM2151_ADD("ym2151", 3580000)
MCFG_YM2151_IRQ_HANDLER(WRITELINE(wpcsnd_device, ym2151_irq_w))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "bg", 0.25)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.25)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "bg", 0.50)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.25) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MCFG_SOUND_ADD("hc55516", HC55516, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "bg", 0.50)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.5)
MACHINE_CONFIG_END
machine_config_constructor wpcsnd_device::device_mconfig_additions() const
@@ -105,7 +107,7 @@ void wpcsnd_device::device_reset()
m_reply_available = false;
}
-void wpcsnd_device::static_set_gfxregion(device_t &device, const char *tag)
+void wpcsnd_device::static_set_romregion(device_t &device, const char *tag)
{
wpcsnd_device &cpuboard = downcast<wpcsnd_device &>(device);
cpuboard.m_rom.set_tag(tag);
diff --git a/src/mame/audio/wpcsnd.h b/src/mame/audio/wpcsnd.h
index 54a9cd3df0b..badaaef58e7 100644
--- a/src/mame/audio/wpcsnd.h
+++ b/src/mame/audio/wpcsnd.h
@@ -13,16 +13,17 @@
#include "cpu/m6809/m6809.h"
#include "sound/ym2151.h"
#include "sound/hc55516.h"
-#include "sound/dac.h"
-#define MCFG_WMS_WPC_SOUND_ADD(_tag, _region) \
- MCFG_DEVICE_ADD(_tag, WPCSND, 0) \
- wpcsnd_device::static_set_gfxregion(*device, _region);
+
+#define MCFG_WPC_ROM_REGION(_region) \
+ wpcsnd_device::static_set_romregion(*device, _region);
#define MCFG_WPC_SOUND_REPLY_CALLBACK(_reply) \
downcast<wpcsnd_device *>(device)->set_reply_callback(DEVCB_##_reply);
-class wpcsnd_device : public device_t
+
+class wpcsnd_device : public device_t,
+ public device_mixer_interface
{
public:
// construction/destruction
@@ -31,7 +32,6 @@ public:
required_device<cpu_device> m_cpu;
required_device<ym2151_device> m_ym2151;
required_device<hc55516_device> m_hc55516;
- required_device<dac_device> m_dac;
required_memory_bank m_cpubank;
required_memory_bank m_fixedbank;
required_memory_region m_rom;
@@ -49,7 +49,7 @@ public:
UINT8 ctrl_r();
UINT8 data_r();
- static void static_set_gfxregion(device_t &device, const char *tag);
+ static void static_set_romregion(device_t &device, const char *tag);
// callbacks
template<class _reply> void set_reply_callback(_reply reply) { m_reply_cb.set_callback(reply); }
@@ -67,7 +67,6 @@ private:
// callback
devcb_write_line m_reply_cb;
-
};
extern const device_type WPCSND;
diff --git a/src/mame/audio/zaccaria.cpp b/src/mame/audio/zaccaria.cpp
index 9c7b8065d42..afb065e6968 100644
--- a/src/mame/audio/zaccaria.cpp
+++ b/src/mame/audio/zaccaria.cpp
@@ -2,11 +2,11 @@
// copyright-holders:Vas Crabb
#include "emu.h"
#include "audio/zaccaria.h"
-
#include "cpu/m6800/m6800.h"
#include "machine/clock.h"
#include "machine/rescap.h"
#include "sound/dac.h"
+#include "sound/volt_reg.h"
//**************************************************************************
@@ -128,7 +128,7 @@ static ADDRESS_MAP_START(zac1b11142_audio_map, AS_PROGRAM, 8, zac1b11142_audio_d
ADDRESS_MAP_UNMAP_HIGH
AM_RANGE(0x0000, 0x007f) AM_RAM // 6802 internal RAM
AM_RANGE(0x0090, 0x0093) AM_MIRROR(0x8f6c) AM_DEVREADWRITE("pia_1i", pia6821_device, read, write)
- AM_RANGE(0x1000, 0x1000) AM_MIRROR(0x83ff) AM_DEVWRITE("dac_1f", dac_device, write_unsigned8) // MC1408
+ AM_RANGE(0x1000, 0x1000) AM_MIRROR(0x83ff) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(0x1400, 0x1400) AM_MIRROR(0xc3ff) AM_WRITE(melody_command_w)
AM_RANGE(0x1800, 0x1800) AM_MIRROR(0xc3ff) AM_READ(host_command_r)
AM_RANGE(0x2000, 0x2fff) AM_MIRROR(0x8000) AM_ROM // ROM 8 with A12 low
@@ -200,8 +200,9 @@ MACHINE_CONFIG_DERIVED(zac1b11142_config, zac1b111xx_base_config)
MCFG_PIA_WRITEPA_HANDLER(DEVWRITE8("speech", tms5220_device, data_w))
MCFG_PIA_WRITEPB_HANDLER(WRITE8(zac1b11142_audio_device, pia_1i_portb_w))
- MCFG_DAC_ADD("dac_1f")
- MCFG_MIXER_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.80, 0)
+ MCFG_SOUND_ADD("dac", MC1408, 0) MCFG_MIXER_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.40, 0) // mc1408.1f
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
// There is no xtal, the clock is obtained from a RC oscillator as shown in the TMS5220 datasheet (R=100kOhm C=22pF)
// 162kHz measured on pin 3 20 minutes after power on, clock would then be 162.3*4=649.2kHz
diff --git a/src/mame/audio/zaccaria.h b/src/mame/audio/zaccaria.h
index ec717f04db3..5cab5da41c8 100644
--- a/src/mame/audio/zaccaria.h
+++ b/src/mame/audio/zaccaria.h
@@ -25,12 +25,6 @@ extern device_type const ZACCARIA_1B11142;
// DEVICE CONFIGURATION MACROS
//**************************************************************************
-#define MCFG_ZACCARIA_1B11107(_tag) \
- MCFG_DEVICE_ADD(_tag, ZACCARIA_1B11107, 0)
-
-#define MCFG_ZACCARIA_1B11142(_tag) \
- MCFG_DEVICE_ADD(_tag, ZACCARIA_1B11142, 0)
-
#define MCFG_ZACCARIA_1B11142_SET_ACS_CALLBACK(_devcb) \
devcb = &zac1b11142_audio_device::static_set_acs_cb(*device, DEVCB_##_devcb);
diff --git a/src/mame/audio/zaxxon.cpp b/src/mame/audio/zaxxon.cpp
index 720c510b50d..9fc5387f639 100644
--- a/src/mame/audio/zaxxon.cpp
+++ b/src/mame/audio/zaxxon.cpp
@@ -96,7 +96,7 @@ MACHINE_CONFIG_FRAGMENT( zaxxon_samples )
MCFG_SOUND_ADD("samples", SAMPLES, 0)
MCFG_SAMPLES_CHANNELS(12)
MCFG_SAMPLES_NAMES(zaxxon_sample_names)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
MACHINE_CONFIG_END
@@ -196,7 +196,7 @@ MACHINE_CONFIG_FRAGMENT( congo_samples )
MCFG_SOUND_ADD("samples", SAMPLES, 0)
MCFG_SAMPLES_CHANNELS(5)
MCFG_SAMPLES_NAMES(congo_sample_names)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/20pacgal.cpp b/src/mame/drivers/20pacgal.cpp
index 2bc2375d6f3..59705e05803 100644
--- a/src/mame/drivers/20pacgal.cpp
+++ b/src/mame/drivers/20pacgal.cpp
@@ -84,11 +84,12 @@ Graphics: CY37256P160-83AC x 2 (Ultra37000 CPLD family - 160 pin TQFP, 256 Macro
***************************************************************************/
#include "emu.h"
+#include "includes/20pacgal.h"
#include "cpu/z180/z180.h"
#include "machine/eepromser.h"
#include "machine/watchdog.h"
#include "sound/dac.h"
-#include "includes/20pacgal.h"
+#include "sound/volt_reg.h"
/*************************************
@@ -244,7 +245,7 @@ READ8_MEMBER( _25pacman_state::_25pacman_io_87_r )
AM_RANGE(0x87, 0x87) AM_READ( _25pacman_io_87_r ) // not eeprom on this
AM_RANGE(0x87, 0x87) AM_WRITENOP
// AM_RANGE(0x88, 0x88) AM_WRITE(ram_bank_select_w)
- AM_RANGE(0x89, 0x89) AM_DEVWRITE("dac", dac_device, write_signed8)
+ AM_RANGE(0x89, 0x89) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(0x8a, 0x8a) AM_WRITEONLY AM_SHARE("stars_ctrl") /* stars: bits 3-4 = active set; bit 5 = enable */
AM_RANGE(0x8b, 0x8b) AM_WRITEONLY AM_SHARE("flip")
AM_RANGE(0x8c, 0x8c) AM_WRITENOP
@@ -265,7 +266,7 @@ static ADDRESS_MAP_START( 20pacgal_io_map, AS_IO, 8, _20pacgal_state )
AM_RANGE(0x85, 0x86) AM_WRITEONLY AM_SHARE("stars_seed") /* stars: rng seed (lo/hi) */
AM_RANGE(0x87, 0x87) AM_READ_PORT("EEPROMIN") AM_WRITE_PORT("EEPROMOUT")
AM_RANGE(0x88, 0x88) AM_WRITE(ram_bank_select_w)
- AM_RANGE(0x89, 0x89) AM_DEVWRITE("dac", dac_device, write_signed8)
+ AM_RANGE(0x89, 0x89) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(0x8a, 0x8a) AM_WRITEONLY AM_SHARE("stars_ctrl") /* stars: bits 3-4 = active set; bit 5 = enable */
AM_RANGE(0x8b, 0x8b) AM_WRITEONLY AM_SHARE("flip")
AM_RANGE(0x8f, 0x8f) AM_WRITE(_20pacgal_coin_counter_w)
@@ -402,14 +403,15 @@ static MACHINE_CONFIG_START( 20pacgal, _20pacgal_state )
MCFG_FRAGMENT_ADD(20pacgal_video)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_SOUND_ADD("namco", NAMCO_CUS30, NAMCO_AUDIO_CLOCK)
MCFG_NAMCO_AUDIO_VOICES(3)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/4004clk.cpp b/src/mame/drivers/4004clk.cpp
index 224102e80ef..3408f0eb25e 100644
--- a/src/mame/drivers/4004clk.cpp
+++ b/src/mame/drivers/4004clk.cpp
@@ -11,6 +11,7 @@
#include "emu.h"
#include "cpu/i4004/i4004.h"
#include "sound/dac.h"
+#include "sound/volt_reg.h"
#include "4004clk.lh"
class nixieclock_state : public driver_device
@@ -19,17 +20,14 @@ public:
nixieclock_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
- m_dac(*this, "dac"),
m_input(*this, "INPUT")
{ }
required_device<i4004_cpu_device> m_maincpu;
- required_device<dac_device> m_dac;
required_ioport m_input;
DECLARE_READ8_MEMBER( data_r );
DECLARE_WRITE8_MEMBER( nixie_w );
DECLARE_WRITE8_MEMBER( neon_w );
- DECLARE_WRITE8_MEMBER( relays_w );
UINT16 m_nixie[16];
UINT8 m_timer;
virtual void machine_start() override;
@@ -88,11 +86,6 @@ WRITE8_MEMBER(nixieclock_state::neon_w)
output_set_neon_value(3,BIT(data,0));
}
-WRITE8_MEMBER(nixieclock_state::relays_w)
-{
- m_dac->write_unsigned8((data & 1) ? 0x80 : 0x40); //tick - tock
-}
-
static ADDRESS_MAP_START(4004clk_rom, AS_PROGRAM, 8, nixieclock_state)
AM_RANGE(0x0000, 0x0FFF) AM_ROM
ADDRESS_MAP_END
@@ -107,7 +100,7 @@ static ADDRESS_MAP_START( 4004clk_io, AS_IO, 8, nixieclock_state)
AM_RANGE(0x00, 0x0e) AM_WRITE(nixie_w)
AM_RANGE(0x00, 0x00) AM_READ(data_r)
AM_RANGE(0x0f, 0x0f) AM_WRITE(neon_w)
- AM_RANGE(0x10, 0x10) AM_WRITE(relays_w)
+ AM_RANGE(0x10, 0x10) AM_DEVWRITE("dac", dac_bit_interface, write)
ADDRESS_MAP_END
/* Input ports */
@@ -159,9 +152,10 @@ static MACHINE_CONFIG_START( 4004clk, nixieclock_state )
MCFG_DEFAULT_LAYOUT(layout_4004clk)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("dac", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT)
MCFG_TIMER_DRIVER_ADD_PERIODIC("4004clk_timer", nixieclock_state, timer_callback, attotime::from_hz(120))
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/40love.cpp b/src/mame/drivers/40love.cpp
index d209e7c3c44..a8ef7726dde 100644
--- a/src/mame/drivers/40love.cpp
+++ b/src/mame/drivers/40love.cpp
@@ -222,11 +222,12 @@ Notes - Has jumper setting for 122HZ or 61HZ)
*/
#include "emu.h"
-#include "cpu/z80/z80.h"
+#include "includes/40love.h"
#include "cpu/m6805/m6805.h"
+#include "cpu/z80/z80.h"
#include "sound/ay8910.h"
#include "sound/dac.h"
-#include "includes/40love.h"
+#include "sound/volt_reg.h"
void fortyl_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
@@ -750,7 +751,7 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, fortyl_state )
AM_RANGE(0xd800, 0xd800) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_WRITE(to_main_w)
AM_RANGE(0xda00, 0xda00) AM_READNOP AM_WRITE(nmi_enable_w) /* unknown read */
AM_RANGE(0xdc00, 0xdc00) AM_WRITE(nmi_disable_w)
- AM_RANGE(0xde00, 0xde00) AM_READNOP AM_DEVWRITE("dac", dac_device, write_signed8) /* signed 8-bit DAC - unknown read */
+ AM_RANGE(0xde00, 0xde00) AM_READNOP AM_DEVWRITE("dac", dac_byte_interface, write) /* signed 8-bit DAC - unknown read */
AM_RANGE(0xe000, 0xefff) AM_ROM /* space for diagnostics ROM */
ADDRESS_MAP_END
@@ -1067,31 +1068,32 @@ static MACHINE_CONFIG_START( 40love, fortyl_state )
MCFG_PALETTE_INIT_OWNER(fortyl_state, fortyl)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("aysnd", AY8910, 2000000)
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(fortyl_state, sound_control_2_w))
MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(fortyl_state, sound_control_3_w))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.1)
MCFG_SOUND_ADD("msm", MSM5232, 8000000/4)
MCFG_MSM5232_SET_CAPACITORS(1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6) /* 1.0 uF capacitors (verified on real PCB) */
- MCFG_SOUND_ROUTE(0, "mono", 1.0) // pin 28 2'-1
- MCFG_SOUND_ROUTE(1, "mono", 1.0) // pin 29 4'-1
- MCFG_SOUND_ROUTE(2, "mono", 1.0) // pin 30 8'-1
- MCFG_SOUND_ROUTE(3, "mono", 1.0) // pin 31 16'-1
- MCFG_SOUND_ROUTE(4, "mono", 1.0) // pin 36 2'-2
- MCFG_SOUND_ROUTE(5, "mono", 1.0) // pin 35 4'-2
- MCFG_SOUND_ROUTE(6, "mono", 1.0) // pin 34 8'-2
- MCFG_SOUND_ROUTE(7, "mono", 1.0) // pin 33 16'-2
+ MCFG_SOUND_ROUTE(0, "speaker", 1.0) // pin 28 2'-1
+ MCFG_SOUND_ROUTE(1, "speaker", 1.0) // pin 29 4'-1
+ MCFG_SOUND_ROUTE(2, "speaker", 1.0) // pin 30 8'-1
+ MCFG_SOUND_ROUTE(3, "speaker", 1.0) // pin 31 16'-1
+ MCFG_SOUND_ROUTE(4, "speaker", 1.0) // pin 36 2'-2
+ MCFG_SOUND_ROUTE(5, "speaker", 1.0) // pin 35 4'-2
+ MCFG_SOUND_ROUTE(6, "speaker", 1.0) // pin 34 8'-2
+ MCFG_SOUND_ROUTE(7, "speaker", 1.0) // pin 33 16'-2
// pin 1 SOLO 8' not mapped
// pin 2 SOLO 16' not mapped
// pin 22 Noise Output not mapped
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.2) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( undoukai, fortyl_state )
@@ -1126,31 +1128,32 @@ static MACHINE_CONFIG_START( undoukai, fortyl_state )
MCFG_PALETTE_INIT_OWNER(fortyl_state, fortyl)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("aysnd", AY8910, 2000000)
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(fortyl_state, sound_control_2_w))
MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(fortyl_state, sound_control_3_w))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.1)
MCFG_SOUND_ADD("msm", MSM5232, 8000000/4)
MCFG_MSM5232_SET_CAPACITORS(1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6) /* 1.0 uF capacitors (verified on real PCB) */
- MCFG_SOUND_ROUTE(0, "mono", 1.0) // pin 28 2'-1
- MCFG_SOUND_ROUTE(1, "mono", 1.0) // pin 29 4'-1
- MCFG_SOUND_ROUTE(2, "mono", 1.0) // pin 30 8'-1
- MCFG_SOUND_ROUTE(3, "mono", 1.0) // pin 31 16'-1
- MCFG_SOUND_ROUTE(4, "mono", 1.0) // pin 36 2'-2
- MCFG_SOUND_ROUTE(5, "mono", 1.0) // pin 35 4'-2
- MCFG_SOUND_ROUTE(6, "mono", 1.0) // pin 34 8'-2
- MCFG_SOUND_ROUTE(7, "mono", 1.0) // pin 33 16'-2
+ MCFG_SOUND_ROUTE(0, "speaker", 1.0) // pin 28 2'-1
+ MCFG_SOUND_ROUTE(1, "speaker", 1.0) // pin 29 4'-1
+ MCFG_SOUND_ROUTE(2, "speaker", 1.0) // pin 30 8'-1
+ MCFG_SOUND_ROUTE(3, "speaker", 1.0) // pin 31 16'-1
+ MCFG_SOUND_ROUTE(4, "speaker", 1.0) // pin 36 2'-2
+ MCFG_SOUND_ROUTE(5, "speaker", 1.0) // pin 35 4'-2
+ MCFG_SOUND_ROUTE(6, "speaker", 1.0) // pin 34 8'-2
+ MCFG_SOUND_ROUTE(7, "speaker", 1.0) // pin 33 16'-2
// pin 1 SOLO 8' not mapped
// pin 2 SOLO 16' not mapped
// pin 22 Noise Output not mapped
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.2) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
/*******************************************************************************/
diff --git a/src/mame/drivers/a310.cpp b/src/mame/drivers/a310.cpp
index 4b5f27395c1..f86afe2db95 100644
--- a/src/mame/drivers/a310.cpp
+++ b/src/mame/drivers/a310.cpp
@@ -70,13 +70,12 @@
#include "emu.h"
#include "cpu/arm/arm.h"
-#include "sound/dac.h"
#include "includes/archimds.h"
+#include "formats/acorn_dsk.h"
#include "machine/i2cmem.h"
-//#include "machine/aakart.h"
#include "machine/ram.h"
#include "machine/wd_fdc.h"
-#include "formats/acorn_dsk.h"
+#include "sound/volt_reg.h"
#include "softlist.h"
class a310_state : public archimedes_state
@@ -151,11 +150,6 @@ DRIVER_INIT_MEMBER(a310_state,a310)
void a310_state::machine_start()
{
archimedes_init();
-
-
-
- // reset the DAC to centerline
- //m_dac->write_signed8(0x80);
}
void a310_state::machine_reset()
@@ -397,30 +391,24 @@ static MACHINE_CONFIG_START( a310, a310_state )
MCFG_SOFTWARE_LIST_ADD("flop_list", "archimedes")
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("dac0", DAC, 0)
- MCFG_SOUND_ROUTE(0, "mono", 0.10)
-
- MCFG_SOUND_ADD("dac1", DAC, 0)
- MCFG_SOUND_ROUTE(0, "mono", 0.10)
-
- MCFG_SOUND_ADD("dac2", DAC, 0)
- MCFG_SOUND_ROUTE(0, "mono", 0.10)
-
- MCFG_SOUND_ADD("dac3", DAC, 0)
- MCFG_SOUND_ROUTE(0, "mono", 0.10)
-
- MCFG_SOUND_ADD("dac4", DAC, 0)
- MCFG_SOUND_ROUTE(0, "mono", 0.10)
-
- MCFG_SOUND_ADD("dac5", DAC, 0)
- MCFG_SOUND_ROUTE(0, "mono", 0.10)
-
- MCFG_SOUND_ADD("dac6", DAC, 0)
- MCFG_SOUND_ROUTE(0, "mono", 0.10)
-
- MCFG_SOUND_ADD("dac7", DAC, 0)
- MCFG_SOUND_ROUTE(0, "mono", 0.10)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac0", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(0, "speaker", 0.1) // unknown DAC
+ MCFG_SOUND_ADD("dac1", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(0, "speaker", 0.1) // unknown DAC
+ MCFG_SOUND_ADD("dac2", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(0, "speaker", 0.1) // unknown DAC
+ MCFG_SOUND_ADD("dac3", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(0, "speaker", 0.1) // unknown DAC
+ MCFG_SOUND_ADD("dac4", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(0, "speaker", 0.1) // unknown DAC
+ MCFG_SOUND_ADD("dac5", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(0, "speaker", 0.1) // unknown DAC
+ MCFG_SOUND_ADD("dac6", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(0, "speaker", 0.1) // unknown DAC
+ MCFG_SOUND_ADD("dac7", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(0, "speaker", 0.1) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac0", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac0", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac1", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac1", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac2", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac2", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac3", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac3", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac4", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac4", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac5", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac5", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac6", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac6", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac7", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac7", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
ROM_START(a310)
diff --git a/src/mame/drivers/advision.cpp b/src/mame/drivers/advision.cpp
index e303e3db28b..ea26784aec5 100644
--- a/src/mame/drivers/advision.cpp
+++ b/src/mame/drivers/advision.cpp
@@ -22,7 +22,7 @@
#include "includes/advision.h"
#include "cpu/mcs48/mcs48.h"
#include "cpu/cop400/cop400.h"
-#include "sound/dac.h"
+#include "sound/volt_reg.h"
#include "softlist.h"
/* Memory Maps */
@@ -85,10 +85,10 @@ static MACHINE_CONFIG_START( advision, advision_state )
MCFG_PALETTE_INIT_OWNER(advision_state, advision)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
-
- MCFG_SOUND_ADD("dac", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_2BIT_BINARY_WEIGHTED, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
/* cartridge */
MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "advision_cart")
diff --git a/src/mame/drivers/alpha68k.cpp b/src/mame/drivers/alpha68k.cpp
index 59676926d2f..d3b882f8394 100644
--- a/src/mame/drivers/alpha68k.cpp
+++ b/src/mame/drivers/alpha68k.cpp
@@ -185,15 +185,16 @@ DIP locations verified from manuals for:
***************************************************************************/
#include "emu.h"
+#include "includes/alpha68k.h"
#include "cpu/m68000/m68000.h"
-#include "cpu/z80/z80.h"
#include "cpu/mcs48/mcs48.h"
+#include "cpu/z80/z80.h"
+#include "sound/2203intf.h"
+#include "sound/3812intf.h"
#include "sound/ay8910.h"
#include "sound/dac.h"
-#include "sound/3812intf.h"
+#include "sound/volt_reg.h"
#include "sound/ym2413.h"
-#include "sound/2203intf.h"
-#include "includes/alpha68k.h"
@@ -737,7 +738,7 @@ static ADDRESS_MAP_START( kyros_sound_map, AS_PROGRAM, 8, alpha68k_state )
AM_RANGE(0xc000, 0xc7ff) AM_RAM
AM_RANGE(0xe000, 0xe000) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE(0xe002, 0xe002) AM_DEVWRITE("soundlatch", generic_latch_8_device, clear_w)
- AM_RANGE(0xe004, 0xe004) AM_DEVWRITE("dac", dac_device, write_signed8)
+ AM_RANGE(0xe004, 0xe004) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(0xe006, 0xe00e) AM_WRITENOP // soundboard I/O's, ignored
/* reference only
AM_RANGE(0xe006, 0xe006) AM_WRITENOP // NMI: diminishing saw-tooth
@@ -753,7 +754,7 @@ static ADDRESS_MAP_START( sstingry_sound_map, AS_PROGRAM, 8, alpha68k_state )
AM_RANGE(0x8000, 0x87ff) AM_RAM
AM_RANGE(0xc100, 0xc100) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE(0xc102, 0xc102) AM_DEVWRITE("soundlatch", generic_latch_8_device, clear_w)
- AM_RANGE(0xc104, 0xc104) AM_DEVWRITE("dac", dac_device, write_signed8)
+ AM_RANGE(0xc104, 0xc104) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(0xc106, 0xc10e) AM_WRITENOP // soundboard I/O's, ignored
ADDRESS_MAP_END
@@ -781,7 +782,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( sound_portmap, AS_IO, 8, alpha68k_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x00) AM_DEVREADWRITE("soundlatch", generic_latch_8_device, read, clear_w)
- AM_RANGE(0x08, 0x08) AM_DEVWRITE("dac", dac_device, write_signed8)
+ AM_RANGE(0x08, 0x08) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(0x0a, 0x0b) AM_DEVWRITE("ym2", ym2413_device, write)
AM_RANGE(0x0c, 0x0d) AM_DEVWRITE("ym1", ym2203_device, write)
AM_RANGE(0x0e, 0x0e) AM_WRITE(sound_bank_w)
@@ -1952,21 +1953,22 @@ static MACHINE_CONFIG_START( sstingry, alpha68k_state )
MCFG_PALETTE_INIT_OWNER(alpha68k_state,kyros)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("ym1", YM2203, 3000000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.35)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.35)
MCFG_SOUND_ADD("ym2", YM2203, 3000000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.35)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.35)
MCFG_SOUND_ADD("ym3", YM2203, 3000000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.75) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( kyros, alpha68k_state )
@@ -2003,21 +2005,22 @@ static MACHINE_CONFIG_START( kyros, alpha68k_state )
MCFG_PALETTE_INIT_OWNER(alpha68k_state,kyros)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("ym1", YM2203, XTAL_24MHz/12) /* Verified on bootleg PCB */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.35)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.35)
MCFG_SOUND_ADD("ym2", YM2203, XTAL_24MHz/12) /* Verified on bootleg PCB */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.35)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.35)
MCFG_SOUND_ADD("ym3", YM2203, XTAL_24MHz/12) /* Verified on bootleg PCB */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.9)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.75) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( jongbou, alpha68k_state )
@@ -2053,13 +2056,13 @@ static MACHINE_CONFIG_START( jongbou, alpha68k_state )
MCFG_PALETTE_INIT_OWNER(alpha68k_state,kyros)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("aysnd", AY8910, 2000000)
MCFG_AY8910_PORT_A_READ_CB(DEVREAD8("soundlatch", generic_latch_8_device, read))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.65)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.65)
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( alpha68k_I, alpha68k_state )
@@ -2092,13 +2095,13 @@ static MACHINE_CONFIG_START( alpha68k_I, alpha68k_state )
MCFG_PALETTE_INIT_OWNER(alpha68k_state,paddlem)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("ymsnd", YM3812, 4000000)
MCFG_YM3812_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
INTERRUPT_GEN_MEMBER(alpha68k_state::alpha68k_sound_nmi)
@@ -2139,20 +2142,21 @@ static MACHINE_CONFIG_START( alpha68k_II, alpha68k_state )
MCFG_VIDEO_START_OVERRIDE(alpha68k_state,alpha68k)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("ym1", YM2203, 3000000)
MCFG_AY8910_PORT_A_READ_CB(DEVREAD8("soundlatch", generic_latch_8_device, read))
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(alpha68k_state, porta_w))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.65)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.65)
MCFG_SOUND_ADD("ym2", YM2413, 3579545)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.75) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( btlfieldb, alpha68k_II )
@@ -2194,20 +2198,21 @@ static MACHINE_CONFIG_START( alpha68k_II_gm, alpha68k_state )
MCFG_VIDEO_START_OVERRIDE(alpha68k_state,alpha68k)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("ym1", YM2203, 3000000)
MCFG_AY8910_PORT_A_READ_CB(DEVREAD8("soundlatch", generic_latch_8_device, read))
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(alpha68k_state, porta_w))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.65)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.65)
MCFG_SOUND_ADD("ym2", YM2413, 3579545)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.75) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( alpha68k_V, alpha68k_state )
@@ -2242,20 +2247,21 @@ static MACHINE_CONFIG_START( alpha68k_V, alpha68k_state )
MCFG_VIDEO_START_OVERRIDE(alpha68k_state,alpha68k)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("ym1", YM2203, 3000000)
MCFG_AY8910_PORT_A_READ_CB(DEVREAD8("soundlatch", generic_latch_8_device, read))
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(alpha68k_state, porta_w))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.65)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.65)
MCFG_SOUND_ADD("ym2", YM2413, 3579545)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.75) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( alpha68k_V_sb, alpha68k_state )
@@ -2290,20 +2296,21 @@ static MACHINE_CONFIG_START( alpha68k_V_sb, alpha68k_state )
MCFG_VIDEO_START_OVERRIDE(alpha68k_state,alpha68k)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("ym1", YM2203, 3000000)
MCFG_AY8910_PORT_A_READ_CB(DEVREAD8("soundlatch", generic_latch_8_device, read))
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(alpha68k_state, porta_w))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.65)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.65)
MCFG_SOUND_ADD("ym2", YM2413, 3579545)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.75) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( tnextspc, alpha68k_state )
@@ -2337,13 +2344,13 @@ static MACHINE_CONFIG_START( tnextspc, alpha68k_state )
MCFG_PALETTE_INIT_OWNER(alpha68k_state,paddlem)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("ymsnd", YM3812, 4000000)
MCFG_YM3812_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/amaticmg.cpp b/src/mame/drivers/amaticmg.cpp
index c7e380db196..4fb5c60b078 100644
--- a/src/mame/drivers/amaticmg.cpp
+++ b/src/mame/drivers/amaticmg.cpp
@@ -421,7 +421,7 @@
#include "video/mc6845.h"
#include "machine/i8255.h"
#include "sound/3812intf.h"
-#include "sound/dac.h"
+//#include "sound/dac.h"
#include "suprstar.lh"
@@ -627,7 +627,7 @@ WRITE8_MEMBER(amaticmg_state::out_c_w)
WRITE8_MEMBER( amaticmg_state::unk80_w )
{
-// m_dac->write_unsigned8(data & 0x01); /* Sound DAC */
+// m_dac->write(BIT(data, 0)); /* Sound DAC */
}
@@ -656,8 +656,8 @@ static ADDRESS_MAP_START( amaticmg_portmap, AS_IO, 8, amaticmg_state )
AM_RANGE(0x80, 0x80) AM_WRITE(unk80_w)
AM_RANGE(0xc0, 0xc0) AM_WRITE(rombank_w)
// AM_RANGE(0x00, 0x00) AM_DEVREADWRITE("ppi8255_2", ppi8255_device, read, write)
-// AM_RANGE(0x00, 0x00) AM_DEVWRITE("dac1", dac_device, write_signed8)
-// AM_RANGE(0x00, 0x00) AM_DEVWRITE("dac2", dac_device, write_signed8)
+// AM_RANGE(0x00, 0x00) AM_DEVWRITE("dac1", dac_byte_interface, write)
+// AM_RANGE(0x00, 0x00) AM_DEVWRITE("dac2", dac_byte_interface, write)
ADDRESS_MAP_END
@@ -858,14 +858,10 @@ static MACHINE_CONFIG_START( amaticmg, amaticmg_state )
MCFG_PALETTE_INIT_OWNER(amaticmg_state, amaticmg)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
-
- MCFG_SOUND_ADD("ymsnd", YM3812, SND_CLOCK)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
-
-// MCFG_DAC_ADD("dac") /* Y3014B */
-// MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("ymsnd", YM3812, SND_CLOCK) /* Y3014B DAC */
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/apple3.cpp b/src/mame/drivers/apple3.cpp
index d369a914217..68a43923597 100644
--- a/src/mame/drivers/apple3.cpp
+++ b/src/mame/drivers/apple3.cpp
@@ -17,9 +17,10 @@
***************************************************************************/
#include "emu.h"
-#include "bus/rs232/rs232.h"
#include "includes/apple3.h"
#include "includes/apple2.h"
+#include "bus/rs232/rs232.h"
+#include "sound/volt_reg.h"
#include "formats/ap2_dsk.h"
#include "bus/a2bus/a2cffa.h"
@@ -141,11 +142,13 @@ static MACHINE_CONFIG_START( apple3, apple3_state )
MCFG_VIA6522_IRQ_HANDLER(WRITELINE(apple3_state, apple3_via_1_irq_func))
/* sound */
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD(SPEAKER_TAG, SPEAKER_SOUND, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
- MCFG_SOUND_ADD(DAC_TAG, DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("bell", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.99)
+ MCFG_SOUND_ADD("dac", DAC_6BIT_BINARY_WEIGHTED, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.125) // 6522.b5(pb0-pb5) + 320k,160k,80k,40k,20k,10k
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "bell", 1.0, DAC_VREF_POS_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
+
MCFG_TIMER_DRIVER_ADD_PERIODIC("c040", apple3_state, apple3_c040_tick, attotime::from_hz(2000))
/* internal ram */
diff --git a/src/mame/drivers/applix.cpp b/src/mame/drivers/applix.cpp
index 8b343a19f13..aca9a670e8d 100644
--- a/src/mame/drivers/applix.cpp
+++ b/src/mame/drivers/applix.cpp
@@ -4,7 +4,7 @@
Applix 1616 computer
- See for docs: http;//www.microbee-mspp.org.au
+ See for docs: http://psiphi.server101.com/applix/
First revealed to the world in December 1986 issue of Electronics Today
International (ETI) an Australian electronics magazine which is now defunct.
@@ -40,9 +40,10 @@
#include "cpu/mcs51/mcs51.h"
#include "video/mc6845.h"
#include "machine/6522via.h"
+#include "machine/wd_fdc.h"
#include "sound/dac.h"
#include "sound/wave.h"
-#include "machine/wd_fdc.h"
+#include "sound/volt_reg.h"
#include "formats/applix_dsk.h"
#include "imagedev/cassette.h"
#include "bus/centronics/ctronics.h"
@@ -63,8 +64,8 @@ public:
m_fdc(*this, "fdc"),
m_floppy0(*this, "fdc:0"),
m_floppy1(*this, "fdc:1"),
- m_dacl(*this, "dacl"),
- m_dacr(*this, "dacr"),
+ m_ldac(*this, "ldac"),
+ m_rdac(*this, "rdac"),
m_cass(*this, "cassette"),
m_io_dsw(*this, "DSW"),
m_io_fdc(*this, "FDC"),
@@ -163,8 +164,8 @@ private:
required_device<wd1772_t> m_fdc;
required_device<floppy_connector> m_floppy0;
required_device<floppy_connector> m_floppy1;
- required_device<dac_device> m_dacl;
- required_device<dac_device> m_dacr;
+ required_device<dac_byte_interface> m_ldac;
+ required_device<dac_byte_interface> m_rdac;
required_device<cassette_image_device> m_cass;
required_ioport m_io_dsw;
required_ioport m_io_fdc;
@@ -219,10 +220,10 @@ WRITE16_MEMBER( applix_state::dac_latch_w )
m_dac_latch = data;
if ((m_analog_latch & 0x70) == 0) // right
- m_dacr->write_unsigned8(m_dac_latch);
+ m_rdac->write(m_dac_latch);
else
if ((m_analog_latch & 0x70) == 0x10) // left
- m_dacl->write_unsigned8(m_dac_latch);
+ m_ldac->write(m_dac_latch);
}
//cent = odd, video = even
@@ -849,10 +850,12 @@ static MACHINE_CONFIG_START( applix, applix_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
- MCFG_SOUND_ADD("dacl", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 2.0 )
- MCFG_SOUND_ADD("dacr", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 2.0 )
+ MCFG_SOUND_ADD("ldac", DAC0800, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) // 74ls374.u20 + dac0800.u21 + 4052.u23
+ MCFG_SOUND_ADD("rdac", DAC0800, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) // 74ls374.u20 + dac0800.u21 + 4052.u23
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "ldac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "ldac", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "rdac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "rdac", -1.0, DAC_VREF_NEG_INPUT)
+
MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette")
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.50)
diff --git a/src/mame/drivers/aristmk5.cpp b/src/mame/drivers/aristmk5.cpp
index 46966547f03..ef8adc53f24 100644
--- a/src/mame/drivers/aristmk5.cpp
+++ b/src/mame/drivers/aristmk5.cpp
@@ -170,12 +170,10 @@
#define MASTER_CLOCK XTAL_72MHz /* confirmed */
#include "emu.h"
+#include "includes/archimds.h"
#include "cpu/arm/arm.h"
#include "machine/watchdog.h"
-#include "sound/dac.h"
-#include "includes/archimds.h"
-//#include "machine/i2cmem.h"
-
+#include "sound/volt_reg.h"
class aristmk5_state : public archimedes_state
{
@@ -488,9 +486,6 @@ void aristmk5_state::machine_start()
{
archimedes_init();
- // reset the DAC to centerline
- //m_dac->write_signed8(0x80);
-
m_mk5_2KHz_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(aristmk5_state::mk5_2KHz_callback),this));
m_mk5_VSYNC_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(aristmk5_state::mk5_VSYNC_callback),this));
}
@@ -550,30 +545,24 @@ static MACHINE_CONFIG_START( aristmk5, aristmk5_state )
MCFG_PALETTE_ADD("palette", 0x200)
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DAC_ADD("dac0")
- MCFG_SOUND_ROUTE(0, "mono", 0.10)
-
- MCFG_DAC_ADD("dac1")
- MCFG_SOUND_ROUTE(0, "mono", 0.10)
-
- MCFG_DAC_ADD("dac2")
- MCFG_SOUND_ROUTE(0, "mono", 0.10)
-
- MCFG_DAC_ADD("dac3")
- MCFG_SOUND_ROUTE(0, "mono", 0.10)
-
- MCFG_DAC_ADD("dac4")
- MCFG_SOUND_ROUTE(0, "mono", 0.10)
-
- MCFG_DAC_ADD("dac5")
- MCFG_SOUND_ROUTE(0, "mono", 0.10)
-
- MCFG_DAC_ADD("dac6")
- MCFG_SOUND_ROUTE(0, "mono", 0.10)
-
- MCFG_DAC_ADD("dac7")
- MCFG_SOUND_ROUTE(0, "mono", 0.10)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac0", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(0, "speaker", 0.1) // unknown DAC
+ MCFG_SOUND_ADD("dac1", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(0, "speaker", 0.1) // unknown DAC
+ MCFG_SOUND_ADD("dac2", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(0, "speaker", 0.1) // unknown DAC
+ MCFG_SOUND_ADD("dac3", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(0, "speaker", 0.1) // unknown DAC
+ MCFG_SOUND_ADD("dac4", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(0, "speaker", 0.1) // unknown DAC
+ MCFG_SOUND_ADD("dac5", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(0, "speaker", 0.1) // unknown DAC
+ MCFG_SOUND_ADD("dac6", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(0, "speaker", 0.1) // unknown DAC
+ MCFG_SOUND_ADD("dac7", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(0, "speaker", 0.1) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac0", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac0", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac1", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac1", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac2", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac2", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac3", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac3", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac4", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac4", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac5", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac5", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac6", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac6", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac7", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac7", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( aristmk5_usa, aristmk5_state )
@@ -598,30 +587,24 @@ static MACHINE_CONFIG_START( aristmk5_usa, aristmk5_state )
MCFG_PALETTE_ADD("palette", 0x200)
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DAC_ADD("dac0")
- MCFG_SOUND_ROUTE(0, "mono", 0.10)
-
- MCFG_DAC_ADD("dac1")
- MCFG_SOUND_ROUTE(0, "mono", 0.10)
-
- MCFG_DAC_ADD("dac2")
- MCFG_SOUND_ROUTE(0, "mono", 0.10)
-
- MCFG_DAC_ADD("dac3")
- MCFG_SOUND_ROUTE(0, "mono", 0.10)
-
- MCFG_DAC_ADD("dac4")
- MCFG_SOUND_ROUTE(0, "mono", 0.10)
-
- MCFG_DAC_ADD("dac5")
- MCFG_SOUND_ROUTE(0, "mono", 0.10)
-
- MCFG_DAC_ADD("dac6")
- MCFG_SOUND_ROUTE(0, "mono", 0.10)
-
- MCFG_DAC_ADD("dac7")
- MCFG_SOUND_ROUTE(0, "mono", 0.10)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac0", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(0, "speaker", 0.1) // unknown DAC
+ MCFG_SOUND_ADD("dac1", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(0, "speaker", 0.1) // unknown DAC
+ MCFG_SOUND_ADD("dac2", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(0, "speaker", 0.1) // unknown DAC
+ MCFG_SOUND_ADD("dac3", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(0, "speaker", 0.1) // unknown DAC
+ MCFG_SOUND_ADD("dac4", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(0, "speaker", 0.1) // unknown DAC
+ MCFG_SOUND_ADD("dac5", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(0, "speaker", 0.1) // unknown DAC
+ MCFG_SOUND_ADD("dac6", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(0, "speaker", 0.1) // unknown DAC
+ MCFG_SOUND_ADD("dac7", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(0, "speaker", 0.1) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac0", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac0", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac1", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac1", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac2", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac2", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac3", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac3", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac4", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac4", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac5", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac5", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac6", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac6", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac7", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac7", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
#define ARISTOCRAT_MK5_BIOS \
diff --git a/src/mame/drivers/armedf.cpp b/src/mame/drivers/armedf.cpp
index 0dbc5915b60..52eda2e7e2f 100644
--- a/src/mame/drivers/armedf.cpp
+++ b/src/mame/drivers/armedf.cpp
@@ -288,13 +288,13 @@ Notes:
***********************************************************************/
-
#include "emu.h"
+#include "includes/armedf.h"
#include "cpu/m68000/m68000.h"
#include "cpu/z80/z80.h"
-#include "sound/dac.h"
#include "sound/3812intf.h"
-#include "includes/armedf.h"
+#include "sound/dac.h"
+#include "sound/volt_reg.h"
#define LEGION_HACK 0
@@ -747,8 +747,8 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( sound_portmap, AS_IO, 8, armedf_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x0, 0x1) AM_DEVWRITE("ymsnd", ym3812_device, write)
- AM_RANGE(0x2, 0x2) AM_DEVWRITE("dac1", dac_device, write_signed8)
- AM_RANGE(0x3, 0x3) AM_DEVWRITE("dac2", dac_device, write_signed8)
+ AM_RANGE(0x2, 0x2) AM_DEVWRITE("dac1", dac_byte_interface, write)
+ AM_RANGE(0x3, 0x3) AM_DEVWRITE("dac2", dac_byte_interface, write)
AM_RANGE(0x4, 0x4) AM_READ(soundlatch_clear_r)
AM_RANGE(0x6, 0x6) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
ADDRESS_MAP_END
@@ -1203,18 +1203,18 @@ static MACHINE_CONFIG_START( terraf, armedf_state )
MCFG_BUFFERED_SPRITERAM16_ADD("spriteram")
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_8MHz/2)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
-
- MCFG_DAC_ADD("dac1")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
- MCFG_DAC_ADD("dac2")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
+ MCFG_SOUND_ADD("dac1", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.8) // unknown DAC
+ MCFG_SOUND_ADD("dac2", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.8) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac1", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac1", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac2", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac2", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( terrafjb, armedf_state )
@@ -1255,18 +1255,18 @@ static MACHINE_CONFIG_START( terrafjb, armedf_state )
MCFG_BUFFERED_SPRITERAM16_ADD("spriteram")
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_8MHz/2)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
-
- MCFG_DAC_ADD("dac1")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
- MCFG_DAC_ADD("dac2")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
+ MCFG_SOUND_ADD("dac1", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.8) // unknown DAC
+ MCFG_SOUND_ADD("dac2", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.8) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac1", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac1", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac2", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac2", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( terrafb, terraf )
@@ -1309,18 +1309,18 @@ static MACHINE_CONFIG_START( kozure, armedf_state )
MCFG_BUFFERED_SPRITERAM16_ADD("spriteram")
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_8MHz/2)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
- MCFG_DAC_ADD("dac1")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
-
- MCFG_DAC_ADD("dac2")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
+ MCFG_SOUND_ADD("dac1", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.4) // unknown DAC
+ MCFG_SOUND_ADD("dac2", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.4) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac1", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac1", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac2", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac2", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( armedf, armedf_state )
@@ -1357,18 +1357,18 @@ static MACHINE_CONFIG_START( armedf, armedf_state )
MCFG_BUFFERED_SPRITERAM16_ADD("spriteram")
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_8MHz/2)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
-
- MCFG_DAC_ADD("dac1")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
- MCFG_DAC_ADD("dac2")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ADD("dac1", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) // unknown DAC
+ MCFG_SOUND_ADD("dac2", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac1", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac1", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac2", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac2", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( cclimbr2, armedf_state )
@@ -1407,18 +1407,18 @@ static MACHINE_CONFIG_START( cclimbr2, armedf_state )
MCFG_BUFFERED_SPRITERAM16_ADD("spriteram")
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_8MHz/2)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
-
- MCFG_DAC_ADD("dac1")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
- MCFG_DAC_ADD("dac2")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
+ MCFG_SOUND_ADD("dac1", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.4) // unknown DAC
+ MCFG_SOUND_ADD("dac2", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.4) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac1", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac1", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac2", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac2", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( legion, armedf_state )
@@ -1457,18 +1457,18 @@ static MACHINE_CONFIG_START( legion, armedf_state )
MCFG_BUFFERED_SPRITERAM16_ADD("spriteram")
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_8MHz/2)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
- MCFG_DAC_ADD("dac1")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
-
- MCFG_DAC_ADD("dac2")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
+ MCFG_SOUND_ADD("dac1", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.4) // unknown DAC
+ MCFG_SOUND_ADD("dac2", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.4) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac1", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac1", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac2", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac2", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( legionjb, armedf_state )
@@ -1506,18 +1506,18 @@ static MACHINE_CONFIG_START( legionjb, armedf_state )
MCFG_BUFFERED_SPRITERAM16_ADD("spriteram")
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_8MHz/2)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
-
- MCFG_DAC_ADD("dac1")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
- MCFG_DAC_ADD("dac2")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
+ MCFG_SOUND_ADD("dac1", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.4) // unknown DAC
+ MCFG_SOUND_ADD("dac2", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.4) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac1", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac1", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac2", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac2", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
MACHINE_START_MEMBER(bigfghtr_state,bigfghtr)
@@ -1565,18 +1565,18 @@ static MACHINE_CONFIG_START( bigfghtr, bigfghtr_state )
MCFG_BUFFERED_SPRITERAM16_ADD("spriteram")
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_8MHz/2)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
-
- MCFG_DAC_ADD("dac1")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
- MCFG_DAC_ADD("dac2")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ADD("dac1", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0) // unknown DAC
+ MCFG_SOUND_ADD("dac2", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac1", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac1", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac2", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac2", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
/*************************************
diff --git a/src/mame/drivers/atari400.cpp b/src/mame/drivers/atari400.cpp
index 17af5d97240..cf0f2f30691 100644
--- a/src/mame/drivers/atari400.cpp
+++ b/src/mame/drivers/atari400.cpp
@@ -41,13 +41,14 @@
******************************************************************************/
#include "emu.h"
+#include "includes/atari400.h"
#include "cpu/m6502/m6502.h"
#include "machine/6821pia.h"
#include "machine/ram.h"
+#include "machine/atarifdc.h"
#include "sound/dac.h"
#include "sound/pokey.h"
-#include "includes/atari400.h"
-#include "machine/atarifdc.h"
+#include "sound/volt_reg.h"
#include "bus/a800/a800_slot.h"
#include "bus/a800/a800_carts.h"
#include "bus/a800/a8sio.h"
@@ -300,7 +301,7 @@ protected:
//required_device<cpu_device> m_maincpu; // maincpu is already contained in atari_common_state
required_device<ram_device> m_ram;
required_device<pia6821_device> m_pia;
- optional_device<dac_device> m_dac;
+ optional_device<dac_bit_interface> m_dac;
required_memory_region m_region_maincpu;
optional_memory_bank m_0000;
optional_memory_bank m_8000;
@@ -2044,10 +2045,7 @@ MACHINE_START_MEMBER( a400_state, a5200 )
WRITE8_MEMBER(a400_state::gtia_cb)
{
- if (data & 0x08)
- m_dac->write_unsigned8((UINT8)-120);
- else
- m_dac->write_unsigned8(+120);
+ m_dac->write(BIT(data, 3));
}
/**************************************************************
@@ -2104,7 +2102,7 @@ static MACHINE_CONFIG_START( atari_common_nodac, a400_state )
MCFG_A8SIO_SLOT_ADD("a8sio", "sio", nullptr)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_SOUND_ADD("pokey", POKEY, FREQ_17_EXACT)
MCFG_POKEY_POT0_R_CB(IOPORT("analog_0"))
MCFG_POKEY_POT1_R_CB(IOPORT("analog_1"))
@@ -2119,12 +2117,13 @@ static MACHINE_CONFIG_START( atari_common_nodac, a400_state )
MCFG_POKEY_KEYBOARD_CB(atari_common_state, a800_keyboard)
MCFG_POKEY_INTERRUPT_CB(atari_common_state, interrupt_cb)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( atari_common, atari_common_nodac )
- MCFG_SOUND_ADD("dac", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.03)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT)
/* internal ram */
MCFG_RAM_ADD(RAM_TAG)
@@ -2319,7 +2318,7 @@ static MACHINE_CONFIG_DERIVED( a5200, atari_common_nodac )
MCFG_POKEY_KEYBOARD_CB(atari_common_state, a5200_keypads)
MCFG_POKEY_INTERRUPT_CB(atari_common_state, interrupt_cb)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MCFG_DEVICE_ADD("gtia", ATARI_GTIA, 0)
diff --git a/src/mame/drivers/atari_s1.cpp b/src/mame/drivers/atari_s1.cpp
index 9807399b3b5..1d39882ea7a 100644
--- a/src/mame/drivers/atari_s1.cpp
+++ b/src/mame/drivers/atari_s1.cpp
@@ -47,6 +47,7 @@ ToDo:
#include "cpu/m6800/m6800.h"
#include "machine/watchdog.h"
#include "sound/dac.h"
+#include "sound/volt_reg.h"
#include "atari_s1.lh"
@@ -98,7 +99,7 @@ private:
virtual void machine_reset() override;
required_device<cpu_device> m_maincpu;
required_shared_ptr<UINT8> m_p_ram;
- required_device<dac_device> m_dac;
+ required_device<dac_4bit_r2r_device> m_dac;
required_ioport_array<10> m_switch;
};
@@ -403,7 +404,7 @@ TIMER_DEVICE_CALLBACK_MEMBER( atari_s1_state::timer_s )
{
m_timer_s[2]++;
offs_t offs = (m_timer_s[2] & 31) | ((m_1080 & 15) << 5);
- m_dac->write_unsigned8(m_p_prom[offs]<< 4);
+ m_dac->write(m_p_prom[offs]);
}
else
m_timer_s[2] = 0;
@@ -425,6 +426,7 @@ void atari_s1_state::machine_reset()
{
m_p_prom = memregion("proms")->base();
m_vol = 0;
+ m_dac->set_output_gain(0, 0);
m_t_c = 0;
m_audiores = 0;
}
@@ -438,9 +440,11 @@ static MACHINE_CONFIG_START( atari_s1, atari_s1_state )
/* Sound */
MCFG_FRAGMENT_ADD( genpin_audio )
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("dac", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.60)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+
+ MCFG_SOUND_ADD("dac", DAC_4BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.3) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
/* Video */
MCFG_DEFAULT_LAYOUT(layout_atari_s1)
diff --git a/src/mame/drivers/atari_s2.cpp b/src/mame/drivers/atari_s2.cpp
index 69f77261570..2727c0522be 100644
--- a/src/mame/drivers/atari_s2.cpp
+++ b/src/mame/drivers/atari_s2.cpp
@@ -25,6 +25,7 @@ ToDo:
#include "cpu/m6800/m6800.h"
#include "machine/watchdog.h"
#include "sound/dac.h"
+#include "sound/volt_reg.h"
#include "atari_s2.lh"
@@ -58,8 +59,8 @@ private:
UINT8 *m_p_prom;
virtual void machine_reset() override;
required_device<cpu_device> m_maincpu;
- required_device<dac_device> m_dac;
- required_device<dac_device> m_dac1;
+ required_device<dac_4bit_binary_weighted_device> m_dac;
+ required_device<dac_3bit_binary_weighted_device> m_dac1;
};
@@ -391,7 +392,7 @@ TIMER_DEVICE_CALLBACK_MEMBER( atari_s2_state::timer_s )
m_timer_s[2]++;
offs_t offs = (m_timer_s[2] & 31) | ((m_sound0 & 15) << 5);
if (BIT(m_sound0, 6))
- m_dac->write_unsigned8(m_p_prom[offs]<< 4);
+ m_dac->write(m_p_prom[offs]);
// noise
if (BIT(m_sound0, 7))
{
@@ -399,7 +400,7 @@ TIMER_DEVICE_CALLBACK_MEMBER( atari_s2_state::timer_s )
bool ab1 = !BIT(m_timer_s[3], 1);
m_timer_s[3] = (m_timer_s[3] << 1) | ab0;
m_timer_s[4] = (m_timer_s[4] << 1) | ab1;
- m_dac1->write_unsigned8((m_timer_s[4] & 7)<< 5);
+ m_dac1->write(m_timer_s[4] & 7);
}
else
{
@@ -419,7 +420,7 @@ WRITE8_MEMBER( atari_s2_state::sound0_w )
m_sound0 = data;
offs_t offs = (m_timer_s[2] & 31) | ((m_sound0 & 15) << 5);
if (BIT(m_sound0, 6))
- m_dac->write_unsigned8(m_p_prom[offs]<< 4);
+ m_dac->write(m_p_prom[offs]);
}
// d0-3 = volume
@@ -432,6 +433,7 @@ WRITE8_MEMBER( atari_s2_state::sound1_w )
if (data != m_vol)
{
+ // 4066 + r65-r68 (68k,33k,18k,8.2k)
m_vol = data;
float vol = m_vol/16.666+0.1;
m_dac->set_output_gain(0, vol);
@@ -451,6 +453,8 @@ void atari_s2_state::machine_reset()
{
m_p_prom = memregion("proms")->base();
m_vol = 0;
+ m_dac->set_output_gain(0,0);
+ m_dac1->set_output_gain(0,0);
m_sound0 = 0;
m_sound1 = 0;
}
@@ -465,11 +469,13 @@ static MACHINE_CONFIG_START( atari_s2, atari_s2_state )
/* Sound */
MCFG_FRAGMENT_ADD( genpin_audio )
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("dac", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.60)
- MCFG_SOUND_ADD("dac1", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.60)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+
+ MCFG_SOUND_ADD("dac", DAC_4BIT_BINARY_WEIGHTED, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.15) // r23-r26 (68k,33k,18k,8.2k)
+ MCFG_SOUND_ADD("dac1", DAC_3BIT_BINARY_WEIGHTED, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.15) // r18-r20 (100k,47k,100k)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac1", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac1", -1.0, DAC_VREF_NEG_INPUT)
/* Video */
MCFG_DEFAULT_LAYOUT(layout_atari_s2)
diff --git a/src/mame/drivers/barata.cpp b/src/mame/drivers/barata.cpp
index e4e2b974ca5..e4d6a2c2e1a 100644
--- a/src/mame/drivers/barata.cpp
+++ b/src/mame/drivers/barata.cpp
@@ -11,7 +11,7 @@
Manufactured by Matic: http://maticplay.com.br/
This driver still only emulates an early prototype of the game.
- Propper dumps of the actual released game is still lacking.
+ Proper dumps of the actual released game is still lacking.
Photos on the web make us believe that there are at least 2 official
releases of this game.
@@ -38,7 +38,6 @@
#include "emu.h"
#include "cpu/mcs51/mcs51.h"
-#include "sound/dac.h"
#include "barata.lh"
#include "rendlay.h"
@@ -47,8 +46,7 @@ class barata_state : public driver_device
public:
barata_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
- m_maincpu(*this, "maincpu"),
- m_dac(*this, "dac") { }
+ m_maincpu(*this, "maincpu") { }
DECLARE_WRITE8_MEMBER(fpga_w);
DECLARE_WRITE8_MEMBER(port0_w);
DECLARE_WRITE8_MEMBER(port2_w);
@@ -56,7 +54,6 @@ public:
void fpga_send(unsigned char cmd);
required_device<cpu_device> m_maincpu;
- required_device<dac_device> m_dac;
private:
unsigned char row_selection;
};
@@ -313,9 +310,7 @@ static MACHINE_CONFIG_START( barata, barata_state )
MCFG_DEFAULT_LAYOUT( layout_barata )
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.55)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
/* TODO: add sound samples */
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/barni.cpp b/src/mame/drivers/barni.cpp
index 6d6a8113215..ffd4cbeb15d 100644
--- a/src/mame/drivers/barni.cpp
+++ b/src/mame/drivers/barni.cpp
@@ -21,7 +21,6 @@ SOUND: basically the same as Bally's Squalk & Talk -61 board but missing AY891
#include "cpu/m6809/m6809.h"
#include "machine/6522via.h"
#include "machine/6821pia.h"
-#include "sound/dac.h"
#include "sound/tms5220.h"
class barni_state : public genpin_class
diff --git a/src/mame/drivers/beezer.cpp b/src/mame/drivers/beezer.cpp
index eaac517988c..ce5630be6e1 100644
--- a/src/mame/drivers/beezer.cpp
+++ b/src/mame/drivers/beezer.cpp
@@ -14,7 +14,6 @@
#include "emu.h"
#include "machine/6522via.h"
#include "cpu/m6809/m6809.h"
-#include "sound/dac.h"
#include "includes/beezer.h"
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, beezer_state )
@@ -108,12 +107,10 @@ static MACHINE_CONFIG_START( beezer, beezer_state )
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
- //MCFG_DAC_ADD("dac")
- //MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MCFG_SOUND_ADD("custom", BEEZER, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
/* via */
MCFG_DEVICE_ADD("via6522_0", VIA6522, 0)
diff --git a/src/mame/drivers/bking.cpp b/src/mame/drivers/bking.cpp
index b85088542c8..b7034cff81b 100644
--- a/src/mame/drivers/bking.cpp
+++ b/src/mame/drivers/bking.cpp
@@ -18,12 +18,13 @@ DIP Locations verified for:
***************************************************************************/
#include "emu.h"
-#include "cpu/z80/z80.h"
+#include "includes/bking.h"
#include "cpu/m6805/m6805.h"
+#include "cpu/z80/z80.h"
#include "machine/watchdog.h"
#include "sound/ay8910.h"
#include "sound/dac.h"
-#include "includes/bking.h"
+#include "sound/volt_reg.h"
READ8_MEMBER(bking_state::bking_sndnmi_disable_r)
@@ -481,20 +482,21 @@ static MACHINE_CONFIG_START( bking, bking_state )
MCFG_PALETTE_INIT_OWNER(bking_state, bking)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("ay1", AY8910, XTAL_6MHz/4)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
MCFG_SOUND_ADD("ay2", AY8910, XTAL_6MHz/4)
- MCFG_AY8910_PORT_A_WRITE_CB(DEVWRITE8("dac", dac_device, write_signed8))
+ MCFG_AY8910_PORT_A_WRITE_CB(DEVWRITE8("dac", dac_byte_interface, write))
MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(bking_state, port_b_w))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( bking3, bking )
diff --git a/src/mame/drivers/blitz68k.cpp b/src/mame/drivers/blitz68k.cpp
index ffa7d6215c8..5eb8b53fc29 100644
--- a/src/mame/drivers/blitz68k.cpp
+++ b/src/mame/drivers/blitz68k.cpp
@@ -47,7 +47,6 @@ To Do:
#include "emu.h"
#include "cpu/m68000/m68000.h"
#include "video/mc6845.h"
-#include "sound/dac.h"
#include "sound/saa1099.h"
#include "machine/nvram.h"
#include "video/ramdac.h"
@@ -1690,10 +1689,6 @@ static MACHINE_CONFIG_START( ilpag, blitz68k_state )
MCFG_VIDEO_START_OVERRIDE(blitz68k_state,blitz68k)
MCFG_RAMDAC_ADD("ramdac", ramdac_map, "palette")
-
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
MACHINE_CONFIG_END
/*
@@ -1767,10 +1762,6 @@ static MACHINE_CONFIG_START( cjffruit, blitz68k_state )
MCFG_VIDEO_START_OVERRIDE(blitz68k_state,blitz68k)
MCFG_RAMDAC_ADD("ramdac", ramdac_map, "palette")
-
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
MACHINE_CONFIG_END
@@ -1803,10 +1794,6 @@ static MACHINE_CONFIG_START( bankrob, blitz68k_state )
MCFG_VIDEO_START_OVERRIDE(blitz68k_state,blitz68k)
MCFG_RAMDAC_ADD("ramdac", ramdac_map, "palette")
-
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
MACHINE_CONFIG_END
@@ -1837,10 +1824,6 @@ static MACHINE_CONFIG_START( bankroba, blitz68k_state )
MCFG_VIDEO_START_OVERRIDE(blitz68k_state,blitz68k_addr_factor1)
MCFG_RAMDAC_ADD("ramdac", ramdac_map, "palette")
-
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
MACHINE_CONFIG_END
@@ -1870,10 +1853,6 @@ static MACHINE_CONFIG_START( deucesw2, blitz68k_state )
MCFG_VIDEO_START_OVERRIDE(blitz68k_state,blitz68k)
MCFG_RAMDAC_ADD("ramdac", ramdac_map, "palette")
-
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
MACHINE_CONFIG_END
@@ -1905,10 +1884,6 @@ static MACHINE_CONFIG_START( dualgame, blitz68k_state )
MCFG_VIDEO_START_OVERRIDE(blitz68k_state,blitz68k)
MCFG_RAMDAC_ADD("ramdac", ramdac_map, "palette")
-
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
MACHINE_CONFIG_END
@@ -1938,10 +1913,6 @@ static MACHINE_CONFIG_START( hermit, blitz68k_state )
MCFG_VIDEO_START_OVERRIDE(blitz68k_state,blitz68k)
MCFG_RAMDAC_ADD("ramdac", ramdac_map, "palette")
-
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/bw12.cpp b/src/mame/drivers/bw12.cpp
index 8942f44fe1d..7a0328ad0a9 100644
--- a/src/mame/drivers/bw12.cpp
+++ b/src/mame/drivers/bw12.cpp
@@ -27,7 +27,10 @@
#include "includes/bw12.h"
#include "bus/rs232/rs232.h"
+#include "sound/dac.h"
+#include "sound/volt_reg.h"
#include "softlist.h"
+
/*
TODO:
@@ -176,7 +179,7 @@ static ADDRESS_MAP_START( bw12_io, AS_IO, 8, bw12_state )
AM_RANGE(0x20, 0x21) AM_MIRROR(0x0e) AM_DEVICE(UPD765_TAG, upd765a_device, map)
AM_RANGE(0x30, 0x33) AM_MIRROR(0x0c) AM_DEVREADWRITE(PIA6821_TAG, pia6821_device, read, write)
AM_RANGE(0x40, 0x43) AM_MIRROR(0x0c) AM_DEVREADWRITE(Z80SIO_TAG, z80sio0_device, ba_cd_r, ba_cd_w)
- AM_RANGE(0x50, 0x50) AM_MIRROR(0x0f) AM_DEVWRITE(MC1408_TAG, dac_device, write_unsigned8)
+ AM_RANGE(0x50, 0x50) AM_MIRROR(0x0f) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(0x60, 0x63) AM_MIRROR(0x0c) AM_DEVREADWRITE(PIT8253_TAG, pit8253_device, read, write)
ADDRESS_MAP_END
@@ -560,10 +563,10 @@ static MACHINE_CONFIG_START( common, bw12_state )
MCFG_MC6845_UPDATE_ROW_CB(bw12_state, crtc_update_row)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
-
- MCFG_SOUND_ADD(MC1408_TAG, DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", MC1408, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.125) // ls273.ic5 + mc1408.ic4
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
/* devices */
MCFG_TIMER_DRIVER_ADD(FLOPPY_TIMER_TAG, bw12_state, floppy_motor_off_tick)
diff --git a/src/mame/drivers/bwing.cpp b/src/mame/drivers/bwing.cpp
index cc832d5f60b..8c047cd50f1 100644
--- a/src/mame/drivers/bwing.cpp
+++ b/src/mame/drivers/bwing.cpp
@@ -25,11 +25,12 @@ Known issues:
// Directives
#include "emu.h"
-#include "cpu/m6809/m6809.h"
+#include "includes/bwing.h"
#include "cpu/m6502/deco16.h"
+#include "cpu/m6809/m6809.h"
#include "sound/ay8910.h"
#include "sound/dac.h"
-#include "includes/bwing.h"
+#include "sound/volt_reg.h"
//****************************************************************************
@@ -154,7 +155,7 @@ ADDRESS_MAP_END
// Sound CPU
static ADDRESS_MAP_START( bwp3_map, AS_PROGRAM, 8, bwing_state )
AM_RANGE(0x0000, 0x01ff) AM_RAM
- AM_RANGE(0x0200, 0x0200) AM_DEVWRITE("dac", dac_device, write_signed8)
+ AM_RANGE(0x0200, 0x0200) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(0x1000, 0x1000) AM_WRITE(bwp3_nmiack_w)
AM_RANGE(0x2000, 0x2000) AM_DEVWRITE("ay1", ay8910_device, data_w)
AM_RANGE(0x4000, 0x4000) AM_DEVWRITE("ay1", ay8910_device, address_w)
@@ -392,18 +393,19 @@ static MACHINE_CONFIG_START( bwing, bwing_state )
// sound hardware
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("ay1", AY8910, 1500000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
MCFG_SOUND_ADD("ay2", AY8910, 1500000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.1) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
//****************************************************************************
diff --git a/src/mame/drivers/by6803.cpp b/src/mame/drivers/by6803.cpp
index 017e80256f7..2d11daa4ba6 100644
--- a/src/mame/drivers/by6803.cpp
+++ b/src/mame/drivers/by6803.cpp
@@ -400,9 +400,9 @@ static MACHINE_CONFIG_START( by6803, by6803_state )
MCFG_PIA_WRITEPB_HANDLER(WRITE8(by6803_state, pia1_b_w))
MCFG_PIA_CB2_HANDLER(WRITELINE(by6803_state, pia1_cb2_w))
- //MCFG_SPEAKER_STANDARD_MONO("mono")
- //MCFG_MIDWAY_TURBO_CHIP_SQUEAK_ADD("tcs") // Cheap Squeak Turbo
- //MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ //MCFG_SPEAKER_STANDARD_MONO("speaker")
+ //MCFG_SOUND_ADD("tcs", MIDWAY_TURBO_CHIP_SQUEAK, 0) // Cheap Squeak Turbo
+ //MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/byvid.cpp b/src/mame/drivers/byvid.cpp
index cac3fc83d4f..33461908dac 100644
--- a/src/mame/drivers/byvid.cpp
+++ b/src/mame/drivers/byvid.cpp
@@ -42,9 +42,10 @@ ToDo (granny):
#include "cpu/m6809/m6809.h"
#include "video/tms9928a.h"
#include "machine/6821pia.h"
-#include "sound/dac.h"
#include "machine/nvram.h"
#include "sound/beep.h"
+#include "sound/dac.h"
+#include "sound/volt_reg.h"
class by133_state : public driver_device
{
@@ -179,7 +180,7 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, by133_state ) // U27 Vidiot
ADDRESS_MAP_END
static ADDRESS_MAP_START( sound_portmap, AS_IO, 8, by133_state )
- AM_RANGE(M6801_PORT1, M6801_PORT1) AM_DEVWRITE("dac", dac_device, write_unsigned8) // P10-P17
+ AM_RANGE(M6801_PORT1, M6801_PORT1) AM_DEVWRITE("dac", dac_byte_interface, write) // P10-P17
AM_RANGE(M6801_PORT2, M6801_PORT2) AM_READWRITE(m6803_port2_r, m6803_port2_w) // P20-P24 sound command in
ADDRESS_MAP_END
@@ -792,9 +793,11 @@ static MACHINE_CONFIG_START( babypac, by133_state )
MCFG_SCREEN_UPDATE_DEVICE( "crtc", tms9928a_device, screen_update )
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
+
MCFG_SPEAKER_STANDARD_MONO("beee")
MCFG_SOUND_ADD("beeper", BEEP, 600)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "beee", 0.10)
diff --git a/src/mame/drivers/c128.cpp b/src/mame/drivers/c128.cpp
index 2ab7999827e..88d65a9afa2 100644
--- a/src/mame/drivers/c128.cpp
+++ b/src/mame/drivers/c128.cpp
@@ -27,7 +27,6 @@
#include "machine/mos8722.h"
#include "machine/pla.h"
#include "machine/ram.h"
-#include "sound/dac.h"
#include "sound/mos6581.h"
#include "video/mc6845.h"
#include "video/mos6566.h"
@@ -1711,13 +1710,11 @@ static MACHINE_CONFIG_START( ntsc, c128_state )
MCFG_GFXDECODE_ADD("gfxdecode", MOS8563_TAG":palette", c128)
// sound hardware
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_SOUND_ADD(MOS6581_TAG, MOS6581, XTAL_14_31818MHz*2/3.5/8)
MCFG_MOS6581_POTX_CALLBACK(READ8(c128_state, sid_potx_r))
MCFG_MOS6581_POTY_CALLBACK(READ8(c128_state, sid_poty_r))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
- MCFG_SOUND_ADD("dac", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
// devices
MCFG_DEVICE_ADD(MOS8722_TAG, MOS8722, XTAL_14_31818MHz*2/3.5/8)
@@ -1884,13 +1881,11 @@ static MACHINE_CONFIG_START( pal, c128_state )
MCFG_GFXDECODE_ADD("gfxdecode", MOS8563_TAG":palette", c128)
// sound hardware
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_SOUND_ADD(MOS6581_TAG, MOS6581, XTAL_17_734472MHz*2/4.5/8)
MCFG_MOS6581_POTX_CALLBACK(READ8(c128_state, sid_potx_r))
MCFG_MOS6581_POTY_CALLBACK(READ8(c128_state, sid_poty_r))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
- MCFG_SOUND_ADD("dac", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
// devices
MCFG_DEVICE_ADD(MOS8722_TAG, MOS8722, XTAL_17_734472MHz*2/4.5/8)
diff --git a/src/mame/drivers/calchase.cpp b/src/mame/drivers/calchase.cpp
index 18354d8e5dc..de72447a43d 100644
--- a/src/mame/drivers/calchase.cpp
+++ b/src/mame/drivers/calchase.cpp
@@ -128,24 +128,23 @@ something wrong in the disk geometry reported by calchase.chd (20,255,63) since
#include "emu.h"
+#include "bus/isa/trident.h"
#include "cpu/i386/i386.h"
#include "machine/lpci.h"
#include "machine/pckeybrd.h"
#include "machine/idectrl.h"
-#include "video/pc_vga.h"
-#include "sound/dac.h"
#include "machine/pcshare.h"
#include "machine/ds128x.h"
-#include "bus/isa/trident.h"
+#include "sound/dac.h"
+#include "sound/volt_reg.h"
+#include "video/pc_vga.h"
class calchase_state : public pcat_base_state
{
public:
calchase_state(const machine_config &mconfig, device_type type, const char *tag)
- : pcat_base_state(mconfig, type, tag),
- m_dac_l(*this, "dac_l"),
- m_dac_r(*this, "dac_r")
+ : pcat_base_state(mconfig, type, tag)
{
}
@@ -164,15 +163,11 @@ public:
DECLARE_READ16_MEMBER(calchase_iocard5_r);
DECLARE_READ32_MEMBER(calchase_idle_skip_r);
DECLARE_WRITE32_MEMBER(calchase_idle_skip_w);
- DECLARE_WRITE16_MEMBER(calchase_dac_l_w);
- DECLARE_WRITE16_MEMBER(calchase_dac_r_w);
DECLARE_DRIVER_INIT(calchase);
DECLARE_DRIVER_INIT(hostinv);
virtual void machine_start() override;
virtual void machine_reset() override;
void intel82439tx_init();
- required_device<dac_device> m_dac_l;
- required_device<dac_device> m_dac_r;
};
// Intel 82439TX System Controller (MTXC)
@@ -378,16 +373,6 @@ READ16_MEMBER(calchase_state::calchase_iocard5_r)
}
-WRITE16_MEMBER(calchase_state::calchase_dac_l_w)
-{
- m_dac_l->write_unsigned16((data & 0xfff) << 4);
-}
-
-WRITE16_MEMBER(calchase_state::calchase_dac_r_w)
-{
- m_dac_r->write_unsigned16((data & 0xfff) << 4);
-}
-
static ADDRESS_MAP_START( calchase_map, AS_PROGRAM, 32, calchase_state )
AM_RANGE(0x00000000, 0x0009ffff) AM_RAM
AM_RANGE(0x000a0000, 0x000bffff) AM_DEVREADWRITE8("vga", trident_vga_device, mem_r, mem_w, 0xffffffff) // VGA VRAM
@@ -400,8 +385,8 @@ static ADDRESS_MAP_START( calchase_map, AS_PROGRAM, 32, calchase_state )
AM_RANGE(0x000d0030, 0x000d0033) AM_READ16(calchase_iocard4_r, 0x0000ffff)
AM_RANGE(0x000d0034, 0x000d0037) AM_READ16(calchase_iocard5_r, 0x0000ffff)
AM_RANGE(0x000d0008, 0x000d000b) AM_WRITENOP // ???
- AM_RANGE(0x000d0024, 0x000d0027) AM_WRITE16(calchase_dac_l_w,0x0000ffff)
- AM_RANGE(0x000d0028, 0x000d002b) AM_WRITE16(calchase_dac_r_w,0x0000ffff)
+ AM_RANGE(0x000d0024, 0x000d0027) AM_DEVWRITE16("ldac", dac_word_interface, write, 0x0000ffff)
+ AM_RANGE(0x000d0028, 0x000d002b) AM_DEVWRITE16("rdac", dac_word_interface, write, 0x0000ffff)
AM_RANGE(0x000d0800, 0x000d0fff) AM_ROM AM_REGION("nvram",0) //
AM_RANGE(0x000d0800, 0x000d0fff) AM_RAM // GAME_CMOS
@@ -677,10 +662,11 @@ static MACHINE_CONFIG_START( calchase, calchase_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker","rspeaker")
- MCFG_DAC_ADD("dac_l")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.5)
- MCFG_DAC_ADD("dac_r")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.5)
+ MCFG_SOUND_ADD("ldac", DAC_12BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.25) // unknown DAC
+ MCFG_SOUND_ADD("rdac", DAC_12BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.25) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "ldac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "ldac", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "rdac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "rdac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( hostinv, calchase_state )
@@ -702,11 +688,12 @@ static MACHINE_CONFIG_START( hostinv, calchase_state )
MCFG_FRAGMENT_ADD( pcvideo_trident_vga )
/* sound hardware */
- MCFG_SPEAKER_STANDARD_STEREO("lspeaker","rspeaker")
- MCFG_DAC_ADD("dac_l")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.5)
- MCFG_DAC_ADD("dac_r")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.5)
+ MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_SOUND_ADD("ldac", DAC_12BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.25) // unknown DAC
+ MCFG_SOUND_ADD("rdac", DAC_12BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.25) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "ldac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "ldac", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "rdac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "rdac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/camplynx.cpp b/src/mame/drivers/camplynx.cpp
index 22aa565c06e..c8f17e6514d 100644
--- a/src/mame/drivers/camplynx.cpp
+++ b/src/mame/drivers/camplynx.cpp
@@ -119,9 +119,10 @@
#include "emu.h"
#include "cpu/z80/z80.h"
#include "video/mc6845.h"
-#include "sound/dac.h"
#include "imagedev/cassette.h"
+#include "sound/dac.h"
#include "sound/wave.h"
+#include "sound/volt_reg.h"
#include "formats/camplynx_cas.h"
#include "machine/wd_fdc.h"
#include "formats/camplynx_dsk.h"
@@ -171,7 +172,7 @@ private:
required_device<cassette_image_device> m_cass;
//required_device<> m_printer;
required_device<mc6845_device> m_crtc;
- required_device<dac_device> m_dac;
+ required_device<dac_byte_interface> m_dac;
optional_device<fd1793_t> m_fdc;
optional_device<floppy_connector> m_floppy0;
optional_device<floppy_connector> m_floppy1;
@@ -650,7 +651,7 @@ WRITE8_MEMBER( camplynx_state::port84_w )
m_cass->output(BIT(data, 5) ? -1.0 : +1.0);
}
else // speaker output
- m_dac->write_unsigned8(space, 0, data);
+ m_dac->write(data);
}
/*
@@ -787,11 +788,12 @@ static MACHINE_CONFIG_FRAGMENT( lynx_common )
MCFG_PALETTE_ADD_3BIT_RGB("palette")
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("dac", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.5)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_6BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.375) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.02)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.02)
MACHINE_CONFIG_END
static MACHINE_CONFIG_FRAGMENT( lynx_disk )
diff --git a/src/mame/drivers/capbowl.cpp b/src/mame/drivers/capbowl.cpp
index 52f37d5266e..eed4313b5c3 100644
--- a/src/mame/drivers/capbowl.cpp
+++ b/src/mame/drivers/capbowl.cpp
@@ -93,6 +93,7 @@
#include "includes/capbowl.h"
#include "sound/2203intf.h"
#include "sound/dac.h"
+#include "sound/volt_reg.h"
#define MASTER_CLOCK XTAL_8MHz
@@ -243,7 +244,7 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, capbowl_state )
AM_RANGE(0x0000, 0x07ff) AM_RAM
AM_RANGE(0x1000, 0x1001) AM_DEVREADWRITE("ymsnd", ym2203_device, read, write)
AM_RANGE(0x2000, 0x2000) AM_WRITENOP /* watchdog */
- AM_RANGE(0x6000, 0x6000) AM_DEVWRITE("dac", dac_device, write_unsigned8)
+ AM_RANGE(0x6000, 0x6000) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(0x7000, 0x7000) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE(0x8000, 0xffff) AM_ROM
ADDRESS_MAP_END
@@ -341,7 +342,7 @@ static MACHINE_CONFIG_START( capbowl, capbowl_state )
MCFG_TMS34061_INTERRUPT_CB(INPUTLINE("maincpu", M6809_FIRQ_LINE)) /* interrupt gen callback */
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
@@ -349,13 +350,14 @@ static MACHINE_CONFIG_START( capbowl, capbowl_state )
MCFG_YM2203_IRQ_HANDLER(INPUTLINE("audiocpu", M6809_FIRQ_LINE))
MCFG_AY8910_PORT_A_READ_CB(DEVREAD8("ticket", ticket_dispenser_device, read))
MCFG_AY8910_PORT_B_WRITE_CB(DEVWRITE8("ticket", ticket_dispenser_device, write)) /* Also a status LED. See memory map above */
- MCFG_SOUND_ROUTE(0, "mono", 0.07)
- MCFG_SOUND_ROUTE(1, "mono", 0.07)
- MCFG_SOUND_ROUTE(2, "mono", 0.07)
- MCFG_SOUND_ROUTE(3, "mono", 0.75)
-
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(0, "speaker", 0.07)
+ MCFG_SOUND_ROUTE(1, "speaker", 0.07)
+ MCFG_SOUND_ROUTE(2, "speaker", 0.07)
+ MCFG_SOUND_ROUTE(3, "speaker", 0.75)
+
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/cbm2.cpp b/src/mame/drivers/cbm2.cpp
index 078ae13fdd3..9ebabd01c39 100644
--- a/src/mame/drivers/cbm2.cpp
+++ b/src/mame/drivers/cbm2.cpp
@@ -29,7 +29,6 @@
#include "machine/pic8259.h"
#include "machine/pla.h"
#include "machine/ram.h"
-#include "sound/dac.h"
#include "sound/mos6581.h"
#include "video/mc6845.h"
#include "video/mos6566.h"
diff --git a/src/mame/drivers/cc40.cpp b/src/mame/drivers/cc40.cpp
index f3500bcabbd..e8e04132d12 100644
--- a/src/mame/drivers/cc40.cpp
+++ b/src/mame/drivers/cc40.cpp
@@ -73,12 +73,13 @@
***************************************************************************/
#include "emu.h"
-#include "cpu/tms7000/tms7000.h"
-#include "video/hd44780.h"
-#include "sound/dac.h"
-#include "machine/nvram.h"
#include "bus/generic/slot.h"
#include "bus/generic/carts.h"
+#include "cpu/tms7000/tms7000.h"
+#include "machine/nvram.h"
+#include "sound/dac.h"
+#include "sound/volt_reg.h"
+#include "video/hd44780.h"
#include "softlist.h"
#include "cc40.lh"
@@ -90,7 +91,6 @@ public:
cc40_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
- m_dac(*this, "dac"),
m_cart(*this, "cartslot"),
m_key_matrix(*this, "IN.%u", 0),
m_battery_inp(*this, "BATTERY")
@@ -100,7 +100,6 @@ public:
}
required_device<tms70c20_device> m_maincpu;
- required_device<dac_device> m_dac;
required_device<generic_slot_device> m_cart;
required_ioport_array<8> m_key_matrix;
required_ioport m_battery_inp;
@@ -131,7 +130,6 @@ public:
DECLARE_READ8_MEMBER(bus_control_r);
DECLARE_WRITE8_MEMBER(bus_control_w);
DECLARE_WRITE8_MEMBER(power_w);
- DECLARE_WRITE8_MEMBER(sound_w);
DECLARE_READ8_MEMBER(battery_r);
DECLARE_READ8_MEMBER(bankswitch_r);
DECLARE_WRITE8_MEMBER(bankswitch_w);
@@ -289,12 +287,6 @@ WRITE8_MEMBER(cc40_state::power_w)
m_maincpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
}
-WRITE8_MEMBER(cc40_state::sound_w)
-{
- // d0: piezo control
- m_dac->write_signed8((data & 1) ? 0x7f : 0);
-}
-
READ8_MEMBER(cc40_state::battery_r)
{
// d0: low battery sense line (0 = low power)
@@ -370,7 +362,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, cc40_state )
AM_RANGE(0x0112, 0x0112) AM_NOP // d0-d3: Hexbus data
AM_RANGE(0x0113, 0x0113) AM_NOP // d0: Hexbus available
AM_RANGE(0x0114, 0x0114) AM_NOP // d0,d1: Hexbus handshake
- AM_RANGE(0x0115, 0x0115) AM_WRITE(sound_w)
+ AM_RANGE(0x0115, 0x0115) AM_DEVWRITE("dac", dac_bit_interface, write) // d0: piezo control
AM_RANGE(0x0116, 0x0116) AM_READ(battery_r)
AM_RANGE(0x0119, 0x0119) AM_READWRITE(bankswitch_r, bankswitch_w)
AM_RANGE(0x011a, 0x011a) AM_READWRITE(clock_control_r, clock_control_w)
@@ -609,10 +601,10 @@ static MACHINE_CONFIG_START( cc40, cc40_state )
MCFG_HD44780_PIXEL_UPDATE_CB(cc40_state, cc40_pixel_update)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
-
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT)
/* cartridge */
MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "cc40_cart")
diff --git a/src/mame/drivers/cchasm.cpp b/src/mame/drivers/cchasm.cpp
index 66a27f1467a..c5375bb136c 100644
--- a/src/mame/drivers/cchasm.cpp
+++ b/src/mame/drivers/cchasm.cpp
@@ -15,15 +15,15 @@
***************************************************************************/
#include "emu.h"
+#include "includes/cchasm.h"
#include "cpu/z80/z80.h"
#include "cpu/z80/z80daisy.h"
#include "cpu/m68000/m68000.h"
-#include "sound/ay8910.h"
-#include "sound/dac.h"
#include "machine/6840ptm.h"
#include "machine/z80ctc.h"
#include "machine/watchdog.h"
-#include "includes/cchasm.h"
+#include "sound/ay8910.h"
+#include "sound/volt_reg.h"
#define CCHASM_68K_CLOCK (XTAL_8MHz)
@@ -169,7 +169,7 @@ static MACHINE_CONFIG_START( cchasm, cchasm_state )
MCFG_SCREEN_UPDATE_DEVICE("vector", vector_device, screen_update)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
@@ -177,16 +177,16 @@ static MACHINE_CONFIG_START( cchasm, cchasm_state )
MCFG_GENERIC_LATCH_8_ADD("soundlatch4")
MCFG_SOUND_ADD("ay1", AY8910, 1818182)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.2)
MCFG_SOUND_ADD("ay2", AY8910, 1818182)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
-
- MCFG_DAC_ADD("dac1")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.2)
- MCFG_DAC_ADD("dac2")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ADD("dac1", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
+ MCFG_SOUND_ADD("dac2", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac1", 1.0, DAC_VREF_POS_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac2", 1.0, DAC_VREF_POS_INPUT)
/* 6840 PTM */
MCFG_DEVICE_ADD("6840ptm", PTM6840, 0)
diff --git a/src/mame/drivers/cclimber.cpp b/src/mame/drivers/cclimber.cpp
index f876b126fe1..fa265a400f7 100644
--- a/src/mame/drivers/cclimber.cpp
+++ b/src/mame/drivers/cclimber.cpp
@@ -1140,7 +1140,7 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( cclimber, root )
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_CCLIMBER_AUDIO_ADD("cclimber_audio")
MACHINE_CONFIG_END
@@ -1192,13 +1192,13 @@ static MACHINE_CONFIG_DERIVED( yamato, root )
MCFG_SCREEN_UPDATE_DRIVER(cclimber_state, screen_update_yamato)
/* audio hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_SOUND_ADD("ay1", AY8910, 1536000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
MCFG_SOUND_ADD("ay2", AY8910, 1536000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
MACHINE_CONFIG_END
@@ -1254,15 +1254,15 @@ static MACHINE_CONFIG_START( swimmer, cclimber_state )
MCFG_VIDEO_START_OVERRIDE(cclimber_state,swimmer)
/* audio hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("ay1", AY8910, XTAL_4MHz/2) /* verified on pcb */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
MCFG_SOUND_ADD("ay2", AY8910, XTAL_4MHz/2) /* verified on pcb */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( guzzler, swimmer )
diff --git a/src/mame/drivers/champbas.cpp b/src/mame/drivers/champbas.cpp
index 99fcbc9ee13..c7cbfad74a4 100644
--- a/src/mame/drivers/champbas.cpp
+++ b/src/mame/drivers/champbas.cpp
@@ -79,11 +79,13 @@ TODO:
***************************************************************************/
#include "emu.h"
+#include "includes/champbas.h"
#include "cpu/z80/z80.h"
#include "machine/gen_latch.h"
#include "machine/watchdog.h"
#include "sound/ay8910.h"
-#include "includes/champbas.h"
+#include "sound/dac.h"
+#include "sound/volt_reg.h"
@@ -111,16 +113,6 @@ TIMER_DEVICE_CALLBACK_MEMBER(champbas_state::exctsccr_sound_irq)
m_audiocpu->set_input_line_and_vector(0, HOLD_LINE, 0xff);
}
-WRITE8_MEMBER(champbas_state::dac1_w)
-{
- m_dac1->write_signed8(data << 2);
-}
-
-WRITE8_MEMBER(champbas_state::dac2_w)
-{
- m_dac2->write_signed8(data << 2);
-}
-
/*************************************
@@ -269,7 +261,7 @@ static ADDRESS_MAP_START( champbas_sound_map, AS_PROGRAM, 8, champbas_state )
AM_RANGE(0x6000, 0x6000) AM_MIRROR(0x1fff) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE(0x8000, 0x8000) AM_MIRROR(0x1fff) AM_WRITENOP // 4-bit return code to main CPU (not used)
AM_RANGE(0xa000, 0xa000) AM_MIRROR(0x1fff) AM_DEVWRITE("soundlatch", generic_latch_8_device, clear_w)
- AM_RANGE(0xc000, 0xc000) AM_MIRROR(0x1fff) AM_WRITE(dac1_w)
+ AM_RANGE(0xc000, 0xc000) AM_MIRROR(0x1fff) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(0xe000, 0xe3ff) AM_MIRROR(0x1c00) AM_RAM
ADDRESS_MAP_END
@@ -277,8 +269,8 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( exctsccr_sound_map, AS_PROGRAM, 8, champbas_state )
AM_RANGE(0x0000, 0x8fff) AM_ROM
AM_RANGE(0xa000, 0xa7ff) AM_RAM
- AM_RANGE(0xc008, 0xc008) AM_WRITE(dac1_w)
- AM_RANGE(0xc009, 0xc009) AM_WRITE(dac2_w)
+ AM_RANGE(0xc008, 0xc008) AM_DEVWRITE("dac1", dac_byte_interface, write)
+ AM_RANGE(0xc009, 0xc009) AM_DEVWRITE("dac2", dac_byte_interface, write)
AM_RANGE(0xc00c, 0xc00c) AM_DEVWRITE("soundlatch", generic_latch_8_device, clear_w)
AM_RANGE(0xc00d, 0xc00d) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
// AM_RANGE(0xc00f, 0xc00f) AM_WRITENOP // ?
@@ -554,12 +546,12 @@ static MACHINE_CONFIG_START( talbot, champbas_state )
MCFG_VIDEO_START_OVERRIDE(champbas_state,champbas)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("ay1", AY8910, XTAL_18_432MHz/12)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
MACHINE_CONFIG_END
@@ -591,15 +583,16 @@ static MACHINE_CONFIG_START( champbas, champbas_state )
MCFG_VIDEO_START_OVERRIDE(champbas_state,champbas)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("ay1", AY8910, XTAL_18_432MHz/12)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.3)
- MCFG_DAC_ADD("dac1")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.70)
+ MCFG_SOUND_ADD("dac", DAC_6BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.7) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( champbasj, champbas )
@@ -670,28 +663,28 @@ static MACHINE_CONFIG_START( exctsccr, champbas_state )
MCFG_VIDEO_START_OVERRIDE(champbas_state,exctsccr)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
/* AY (melody) clock is specified by a VR (0.9 - 3.9 MHz) */
MCFG_SOUND_ADD("ay1", AY8910, 1940000) /* VR has a factory mark and this is the value read */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.08)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.08)
MCFG_SOUND_ADD("ay2", AY8910, XTAL_14_31818MHz/8)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.08)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.08)
MCFG_SOUND_ADD("ay3", AY8910, XTAL_14_31818MHz/8)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.08)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.08)
MCFG_SOUND_ADD("ay4", AY8910, XTAL_14_31818MHz/8)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.08)
-
- MCFG_DAC_ADD("dac1")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.08)
- MCFG_DAC_ADD("dac2")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
+ MCFG_SOUND_ADD("dac1", DAC_6BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.3) // unknown DAC
+ MCFG_SOUND_ADD("dac2", DAC_6BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.3) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac1", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac1", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac2", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac2", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
/* Bootleg running on a modified Champion Baseball board */
@@ -726,15 +719,16 @@ static MACHINE_CONFIG_START( exctsccrb, champbas_state )
MCFG_VIDEO_START_OVERRIDE(champbas_state,exctsccr)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("ay1", AY8910, XTAL_18_432MHz/12)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.3)
- MCFG_DAC_ADD("dac1")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.70)
+ MCFG_SOUND_ADD("dac", DAC_6BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.7) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/cheekyms.cpp b/src/mame/drivers/cheekyms.cpp
index 8935f8d20d3..39c9972c1d1 100644
--- a/src/mame/drivers/cheekyms.cpp
+++ b/src/mame/drivers/cheekyms.cpp
@@ -7,9 +7,9 @@
**************************************************************************/
#include "emu.h"
-#include "cpu/z80/z80.h"
-#include "sound/dac.h"
#include "includes/cheekyms.h"
+#include "cpu/z80/z80.h"
+#include "sound/volt_reg.h"
INPUT_CHANGED_MEMBER(cheekyms_state::coin_inserted)
@@ -142,10 +142,25 @@ static MACHINE_CONFIG_START( cheekyms, cheekyms_state )
MCFG_PALETTE_INIT_OWNER(cheekyms_state, cheekyms)
/* audio hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
-
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+
+ MCFG_SOUND_ADD("dac0", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
+ MCFG_SOUND_ADD("dac1", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
+ MCFG_SOUND_ADD("dac2", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
+ MCFG_SOUND_ADD("dac3", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
+ MCFG_SOUND_ADD("dac4", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
+ MCFG_SOUND_ADD("dac5", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
+ MCFG_SOUND_ADD("dac6", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
+ MCFG_SOUND_ADD("dac7", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac0", 1.0, DAC_VREF_POS_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac1", 1.0, DAC_VREF_POS_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac2", 1.0, DAC_VREF_POS_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac3", 1.0, DAC_VREF_POS_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac4", 1.0, DAC_VREF_POS_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac5", 1.0, DAC_VREF_POS_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac6", 1.0, DAC_VREF_POS_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac7", 1.0, DAC_VREF_POS_INPUT)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/chsuper.cpp b/src/mame/drivers/chsuper.cpp
index 261809d255e..bd2d7345ae9 100644
--- a/src/mame/drivers/chsuper.cpp
+++ b/src/mame/drivers/chsuper.cpp
@@ -22,8 +22,9 @@
#include "emu.h"
#include "cpu/z180/z180.h"
-#include "sound/dac.h"
#include "machine/nvram.h"
+#include "sound/dac.h"
+#include "sound/volt_reg.h"
#include "video/ramdac.h"
#include "chsuper.lh"
@@ -218,7 +219,7 @@ static ADDRESS_MAP_START( chsuper_portmap, AS_IO, 8, chsuper_state )
AM_RANGE( 0x00fd, 0x00fd ) AM_DEVWRITE("ramdac", ramdac_device, pal_w)
AM_RANGE( 0x00fe, 0x00fe ) AM_DEVWRITE("ramdac", ramdac_device, mask_w)
AM_RANGE( 0x8300, 0x8300 ) AM_READ_PORT("IN2") // valid input port present in test mode.
- AM_RANGE( 0xff20, 0xff3f ) AM_DEVWRITE("dac", dac_device, write_unsigned8) // unk writes
+ AM_RANGE( 0xff20, 0xff3f ) AM_DEVWRITE("dac", dac_byte_interface, write) // unk writes
ADDRESS_MAP_END
/* About Sound...
@@ -371,10 +372,11 @@ static MACHINE_CONFIG_START( chsuper, chsuper_state )
MCFG_RAMDAC_ADD("ramdac", ramdac_map, "palette")
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/circusc.cpp b/src/mame/drivers/circusc.cpp
index ced692dc44d..91d56abb2ce 100644
--- a/src/mame/drivers/circusc.cpp
+++ b/src/mame/drivers/circusc.cpp
@@ -52,14 +52,14 @@ This bug is due to 380_r02.6h, it differs from 380_q02.6h by 2 bytes, at
***************************************************************************/
#include "emu.h"
+#include "includes/circusc.h"
#include "cpu/z80/z80.h"
-#include "machine/konami1.h"
#include "cpu/m6809/m6809.h"
#include "machine/gen_latch.h"
+#include "machine/konami1.h"
#include "machine/watchdog.h"
-#include "sound/dac.h"
#include "sound/discrete.h"
-#include "includes/circusc.h"
+#include "sound/volt_reg.h"
void circusc_state::machine_start()
@@ -123,7 +123,7 @@ WRITE8_MEMBER(circusc_state::circusc_sound_w)
/* CS5 */
case 3:
- m_dac->write_unsigned8(data);
+ m_dac->write(data);
break;
/* CS6 */
@@ -372,8 +372,9 @@ static MACHINE_CONFIG_START( circusc, circusc_state )
MCFG_SOUND_ADD("sn2", SN76496, XTAL_14_31818MHz/8)
MCFG_SOUND_ROUTE_EX(0, "fltdisc", 1.0, 1)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE_EX(0, "fltdisc", 1.0, 2)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE_EX(0, "fltdisc", 1.0, 2) // ls374.7g + r44+r45+r47+r48+r50+r56+r57+r58+r59 (20k) + r46+r49+r51+r52+r53+r54+r55 (10k) + upc324.3h
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT)
MCFG_SOUND_ADD("fltdisc", DISCRETE, 0)
diff --git a/src/mame/drivers/cntsteer.cpp b/src/mame/drivers/cntsteer.cpp
index 49210c1bc17..7bcc7bc15ae 100644
--- a/src/mame/drivers/cntsteer.cpp
+++ b/src/mame/drivers/cntsteer.cpp
@@ -35,6 +35,7 @@
#include "machine/gen_latch.h"
#include "sound/ay8910.h"
#include "sound/dac.h"
+#include "sound/volt_reg.h"
class cntsteer_state : public driver_device
@@ -524,17 +525,12 @@ WRITE8_MEMBER(cntsteer_state::cntsteer_sub_irq_w)
WRITE8_MEMBER(cntsteer_state::cntsteer_sub_nmi_w)
{
-// if (data)
- machine().scheduler().synchronize(); // force resync
-
- //m_subcpu->set_input_line(M6809_IRQ_LINE, ASSERT_LINE);
m_maincpu->set_input_line(M6809_IRQ_LINE, CLEAR_LINE);
// popmessage("%02x", data);
}
WRITE8_MEMBER(cntsteer_state::cntsteer_main_irq_w)
{
- machine().scheduler().synchronize(); // force resync
m_maincpu->set_input_line(M6809_IRQ_LINE, ASSERT_LINE);
}
@@ -944,19 +940,20 @@ static MACHINE_CONFIG_START( cntsteer, cntsteer_state )
MCFG_VIDEO_START_OVERRIDE(cntsteer_state,cntsteer)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("ay1", AY8910, 1500000)
- MCFG_AY8910_PORT_A_WRITE_CB(DEVWRITE8("dac", dac_device, write_unsigned8))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_AY8910_PORT_A_WRITE_CB(DEVWRITE8("dac", dac_byte_interface, write))
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
MCFG_SOUND_ADD("ay2", AY8910, 1500000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( zerotrgt, cntsteer_state )
@@ -995,15 +992,15 @@ static MACHINE_CONFIG_START( zerotrgt, cntsteer_state )
MCFG_VIDEO_START_OVERRIDE(cntsteer_state,zerotrgt)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("ay1", AY8910, 1500000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
MCFG_SOUND_ADD("ay2", AY8910, 1500000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
MACHINE_CONFIG_END
/***************************************************************************/
diff --git a/src/mame/drivers/coco12.cpp b/src/mame/drivers/coco12.cpp
index bae50cb4dbd..aa9ec9350ad 100644
--- a/src/mame/drivers/coco12.cpp
+++ b/src/mame/drivers/coco12.cpp
@@ -24,15 +24,16 @@
***************************************************************************/
#include "includes/coco12.h"
-#include "imagedev/cassette.h"
-#include "cpu/m6809/m6809.h"
#include "bus/coco/coco_232.h"
#include "bus/coco/coco_orch90.h"
#include "bus/coco/coco_pak.h"
#include "bus/coco/coco_fdc.h"
#include "bus/coco/coco_multi.h"
#include "bus/coco/coco_dwsock.h"
+#include "cpu/m6809/m6809.h"
#include "formats/coco_cas.h"
+#include "imagedev/cassette.h"
+#include "sound/volt_reg.h"
#include "softlist.h"
//**************************************************************************
@@ -270,11 +271,12 @@ SLOT_INTERFACE_END
//-------------------------------------------------
MACHINE_CONFIG_FRAGMENT( coco_sound )
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD(DAC_TAG, DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.125) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/coolpool.cpp b/src/mame/drivers/coolpool.cpp
index 866690da7f5..a1ed7a94ad4 100644
--- a/src/mame/drivers/coolpool.cpp
+++ b/src/mame/drivers/coolpool.cpp
@@ -26,14 +26,12 @@
***************************************************************************/
-#include "emu.h"
+#include "includes/coolpool.h"
#include "cpu/tms32010/tms32010.h"
-#include "cpu/tms34010/tms34010.h"
#include "cpu/tms32025/tms32025.h"
-#include "video/tlc34076.h"
-#include "sound/dac.h"
#include "machine/nvram.h"
-#include "includes/coolpool.h"
+#include "sound/dac.h"
+#include "sound/volt_reg.h"
@@ -528,12 +526,6 @@ WRITE16_MEMBER(coolpool_state::dsp_romaddr_w)
}
-WRITE16_MEMBER(coolpool_state::dsp_dac_w)
-{
- m_dac->write_signed16((INT16)(data << 4) + 0x8000);
-}
-
-
/*************************************
*
@@ -659,7 +651,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( amerdart_dsp_io_map, AS_IO, 16, coolpool_state )
AM_RANGE(0x00, 0x01) AM_WRITE(dsp_romaddr_w)
AM_RANGE(0x02, 0x02) AM_WRITE(amerdart_dsp_answer_w)
- AM_RANGE(0x03, 0x03) AM_WRITE(dsp_dac_w)
+ AM_RANGE(0x03, 0x03) AM_DEVWRITE("dac", dac_word_interface, write)
AM_RANGE(0x04, 0x04) AM_READ(dsp_rom_r)
AM_RANGE(0x05, 0x05) AM_READ_PORT("IN0")
AM_RANGE(0x06, 0x06) AM_READ(amerdart_trackball_r)
@@ -676,7 +668,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( coolpool_dsp_io_map, AS_IO, 16, coolpool_state )
AM_RANGE(0x00, 0x01) AM_WRITE(dsp_romaddr_w)
AM_RANGE(0x02, 0x02) AM_READWRITE(dsp_cmd_r, dsp_answer_w)
- AM_RANGE(0x03, 0x03) AM_WRITE(dsp_dac_w)
+ AM_RANGE(0x03, 0x03) AM_DEVWRITE("dac", dac_word_interface, write)
AM_RANGE(0x04, 0x04) AM_READ(dsp_rom_r)
AM_RANGE(0x05, 0x05) AM_READ_PORT("IN0")
AM_RANGE(0x07, 0x07) AM_READ_PORT("IN1")
@@ -812,10 +804,10 @@ static MACHINE_CONFIG_START( amerdart, coolpool_state )
MCFG_SCREEN_UPDATE_DEVICE("maincpu", tms34010_device, tms340x0_rgb32)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
-
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_12BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
@@ -851,10 +843,10 @@ static MACHINE_CONFIG_START( coolpool, coolpool_state )
MCFG_SCREEN_UPDATE_DEVICE("maincpu", tms34010_device, tms340x0_rgb32)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
-
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_12BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/cosmic.cpp b/src/mame/drivers/cosmic.cpp
index 7aba45dcd58..bc2e4564818 100644
--- a/src/mame/drivers/cosmic.cpp
+++ b/src/mame/drivers/cosmic.cpp
@@ -35,11 +35,11 @@ cosmicg - board can operate in b&w mode if there is no PROM, in this case
#include "emu.h"
+#include "includes/cosmic.h"
#include "cpu/tms9900/tms9980a.h"
#include "cpu/z80/z80.h"
#include "sound/samples.h"
-#include "sound/dac.h"
-#include "includes/cosmic.h"
+#include "sound/volt_reg.h"
/* Schematics show 12 triggers for discrete sound circuits */
@@ -101,21 +101,29 @@ WRITE8_MEMBER(cosmic_state::panic_sound_output_w)
m_samples->stop(4);
break;
- case 10: m_dac->write_unsigned8(data); break;/* Bonus */
- case 15: if (data) m_samples->start(0, 6); break; /* Player Die */
- case 16: if (data) m_samples->start(5, 7); break; /* Enemy Laugh */
- case 17: if (data) m_samples->start(0, 10); break; /* Coin - Not triggered by software */
+ case 10: m_dac->write(BIT(data, 7)); break; /* Bonus */
}
}
#ifdef MAME_DEBUG
- logerror("Sound output %x=%x\n", offset, data);
+ logerror("panic_sound_output_w %x=%x\n", offset, data);
#endif
}
WRITE8_MEMBER(cosmic_state::panic_sound_output2_w)
{
- panic_sound_output_w(space, offset + 15, data);
+ if (m_sound_enabled)
+ {
+ switch (offset)
+ {
+ case 0: if (data) m_samples->start(0, 6); break; /* Player Die */
+ case 1: if (data) m_samples->start(5, 7); break; /* Enemy Laugh */
+ }
+ }
+
+#ifdef MAME_DEBUG
+ logerror("panic_sound_output2_w %x=%x\n", offset, data);
+#endif
}
WRITE8_MEMBER(cosmic_state::cosmicg_output_w)
@@ -136,10 +144,10 @@ WRITE8_MEMBER(cosmic_state::cosmicg_output_w)
switch (offset)
{
/* The schematics show a direct link to the sound amp */
- /* as other cosmic series games, but it never seems to */
- /* be used for anything. It is implemented for sake of */
- /* completness. Maybe it plays a tune if you win ? */
- case 1: m_dac->write_unsigned8(-data); break;
+ /* as other cosmic series games, but it is toggled */
+ /* once during game over. It is implemented for sake */
+ /* of completness. */
+ case 1: m_dac->write(BIT(data, 0)); break; /* Game Over */
case 2: if (data) m_samples->start(0, m_march_select); break; /* March Sound */
case 3: m_march_select = (m_march_select & 0xfe) | data; break;
case 4: m_march_select = (m_march_select & 0xfd) | (data << 1); break;
@@ -167,7 +175,7 @@ WRITE8_MEMBER(cosmic_state::cosmicg_output_w)
break;
case 9: if (data) m_samples->start(3, 11); break; /* Got Ship */
-// case 11: watchdog_reset_w(0, 0); break; /* Watchdog */
+ case 11: /* watchdog_reset_w(0, 0); */ break; /* Watchdog? only toggles during game play */
case 13: if (data) m_samples->start(8, 13 - m_gun_die_select); break; /* Got Monster / Gunshot */
case 14: m_gun_die_select = data; break;
case 15: if (data) m_samples->start(5, 14); break; /* Coin Extend (extra base) */
@@ -175,7 +183,7 @@ WRITE8_MEMBER(cosmic_state::cosmicg_output_w)
}
#ifdef MAME_DEBUG
- if (offset != 11) logerror("Output %x=%x\n", offset, data);
+ if (offset != 11) logerror("cosmicg_output_w %x=%x\n", offset, data);
#endif
}
@@ -203,6 +211,8 @@ WRITE8_MEMBER(cosmic_state::cosmica_sound_output_w)
{
case 0: if (data) m_samples->start(1, 2); break; /*Dive Bombing Type A*/
+ case 1: break; /* game writes 0 when alien shot */
+
case 2: /*Dive Bombing Type B (Main Control)*/
if (data)
{
@@ -311,10 +321,14 @@ WRITE8_MEMBER(cosmic_state::cosmica_sound_output_w)
}
#ifdef MAME_DEBUG
- logerror("Sound output %x=%x\n", offset, data);
+ logerror("cosmica_sound_output_w %x=%x\n", offset, data);
#endif
}
+WRITE8_MEMBER(cosmic_state::dac_w)
+{
+ m_dac->write(BIT(data, 7));
+}
READ8_MEMBER(cosmic_state::cosmica_pixel_clock_r)
{
@@ -406,7 +420,7 @@ static ADDRESS_MAP_START( magspot_map, AS_PROGRAM, 8, cosmic_state )
AM_RANGE(0x0000, 0x2fff) AM_ROM
AM_RANGE(0x3800, 0x3807) AM_READ(magspot_coinage_dip_r)
AM_RANGE(0x4000, 0x401f) AM_WRITEONLY AM_SHARE("spriteram")
- AM_RANGE(0x4800, 0x4800) AM_DEVWRITE("dac", dac_device, write_unsigned8)
+ AM_RANGE(0x4800, 0x4800) AM_WRITE(dac_w)
AM_RANGE(0x480c, 0x480d) AM_WRITE(cosmic_color_register_w)
AM_RANGE(0x480f, 0x480f) AM_WRITE(flip_screen_w)
AM_RANGE(0x5000, 0x5000) AM_READ_PORT("IN0")
@@ -417,10 +431,13 @@ static ADDRESS_MAP_START( magspot_map, AS_PROGRAM, 8, cosmic_state )
ADDRESS_MAP_END
-
-INPUT_CHANGED_MEMBER(cosmic_state::panic_coin_inserted)
+WRITE_LINE_MEMBER(cosmic_state::panic_coin_inserted)
{
- panic_sound_output_w(m_maincpu->space(AS_PROGRAM), 17, newval == 0);
+ if (m_sound_enabled && !state) m_samples->start(0, 10); /* Coin - Not triggered by software */
+
+#ifdef MAME_DEBUG
+ logerror("panic_coin_inserted %x\n", state);
+#endif
}
static INPUT_PORTS_START( panic )
@@ -475,8 +492,8 @@ static INPUT_PORTS_START( panic )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CHANGED_MEMBER(DEVICE_SELF, cosmic_state,panic_coin_inserted, 0)
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_CHANGED_MEMBER(DEVICE_SELF, cosmic_state,panic_coin_inserted, 0)
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, cosmic_state, panic_coin_inserted)
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, cosmic_state, panic_coin_inserted)
INPUT_PORTS_END
INPUT_CHANGED_MEMBER(cosmic_state::cosmica_coin_inserted)
@@ -1026,15 +1043,16 @@ static MACHINE_CONFIG_DERIVED( panic, cosmic )
MCFG_SCREEN_UPDATE_DRIVER(cosmic_state, screen_update_panic)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_SOUND_ADD("samples", SAMPLES, 0)
MCFG_SAMPLES_CHANNELS(9)
MCFG_SAMPLES_NAMES(panic_sample_names)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT)
MACHINE_CONFIG_END
@@ -1054,16 +1072,12 @@ static MACHINE_CONFIG_DERIVED( cosmica, cosmic )
MCFG_SCREEN_UPDATE_DRIVER(cosmic_state, screen_update_cosmica)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_SOUND_ADD("samples", SAMPLES, 0)
MCFG_SAMPLES_CHANNELS(13)
MCFG_SAMPLES_NAMES(cosmica_sample_names)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
-
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
-
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( cosmicg, cosmic_state )
@@ -1090,15 +1104,16 @@ static MACHINE_CONFIG_START( cosmicg, cosmic_state )
MCFG_PALETTE_INIT_OWNER(cosmic_state,cosmicg)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_SOUND_ADD("samples", SAMPLES, 0)
MCFG_SAMPLES_CHANNELS(9)
MCFG_SAMPLES_NAMES(cosmicg_sample_names)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT)
MACHINE_CONFIG_END
@@ -1118,10 +1133,11 @@ static MACHINE_CONFIG_DERIVED( magspot, cosmic )
MCFG_SCREEN_UPDATE_DRIVER(cosmic_state, screen_update_magspot)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT)
MACHINE_CONFIG_END
@@ -1151,10 +1167,11 @@ static MACHINE_CONFIG_DERIVED( nomnlnd, cosmic )
MCFG_SCREEN_UPDATE_DRIVER(cosmic_state, screen_update_nomnlnd)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT)
MACHINE_CONFIG_END
@@ -1568,7 +1585,7 @@ DRIVER_INIT_MEMBER(cosmic_state,nomnlnd)
m_maincpu->space(AS_PROGRAM).install_read_handler(0x5000, 0x5001, read8_delegate(FUNC(cosmic_state::nomnlnd_port_0_1_r),this));
m_maincpu->space(AS_PROGRAM).nop_write(0x4800, 0x4800);
m_maincpu->space(AS_PROGRAM).install_write_handler(0x4807, 0x4807, write8_delegate(FUNC(cosmic_state::cosmic_background_enable_w),this));
- m_maincpu->space(AS_PROGRAM).install_write_handler(0x480a, 0x480a, write8_delegate(FUNC(dac_device::write_unsigned8),(dac_device*)m_dac));
+ m_maincpu->space(AS_PROGRAM).install_write_handler(0x480a, 0x480a, write8_delegate(FUNC(cosmic_state::dac_w), this));
}
DRIVER_INIT_MEMBER(cosmic_state,panic)
diff --git a/src/mame/drivers/craft.cpp b/src/mame/drivers/craft.cpp
index 0601bf3659c..cc2ad5f5d49 100644
--- a/src/mame/drivers/craft.cpp
+++ b/src/mame/drivers/craft.cpp
@@ -11,6 +11,7 @@
#include "emu.h"
#include "cpu/avr8/avr8.h"
#include "sound/dac.h"
+#include "sound/volt_reg.h"
#define VERBOSE_LEVEL (0)
@@ -63,7 +64,7 @@ public:
virtual void machine_reset() override;
UINT32 screen_update_craft(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
inline void verboselog(int n_level, const char *s_fmt, ...) ATTR_PRINTF(3,4);
- required_device<dac_device> m_dac;
+ required_device<dac_byte_interface> m_dac;
};
inline void craft_state::verboselog(int n_level, const char *s_fmt, ...)
@@ -137,7 +138,7 @@ WRITE8_MEMBER(craft_state::port_w)
{
m_port_d = data;
UINT8 audio_sample = (data & 0x02) | ((data & 0xf4) >> 2);
- m_dac->write_unsigned8(audio_sample << 1);
+ m_dac->write(audio_sample);
break;
}
}
@@ -230,8 +231,6 @@ DRIVER_INIT_MEMBER(craft_state,craft)
void craft_state::machine_reset()
{
- m_dac->write_unsigned8(0x00);
-
m_frame_start_cycle = 0;
m_last_cycles = 0;
}
@@ -256,8 +255,9 @@ static MACHINE_CONFIG_START( craft, craft_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("avr8")
- MCFG_SOUND_ADD("dac", DAC, 0)
- MCFG_SOUND_ROUTE(0, "avr8", 1.00)
+ MCFG_SOUND_ADD("dac", DAC_6BIT_R2R, 0) MCFG_SOUND_ROUTE(0, "avr8", 0.25) // pd1/pd2/pd4/pd5/pd6/pd7 + 2k(x7) + 1k(x5)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
ROM_START( craft )
diff --git a/src/mame/drivers/csplayh5.cpp b/src/mame/drivers/csplayh5.cpp
index 3f320093d01..bd49b56a9ef 100644
--- a/src/mame/drivers/csplayh5.cpp
+++ b/src/mame/drivers/csplayh5.cpp
@@ -24,15 +24,16 @@
***********************************************************************************************************/
#include "emu.h"
+#include "cpu/h8/h83002.h"
#include "cpu/m68000/m68000.h"
-#include "machine/tmp68301.h"
-#include "video/v9938.h"
#include "cpu/z80/tmpz84c011.h"
-#include "sound/dac.h"
-#include "sound/3812intf.h"
#include "machine/gen_latch.h"
#include "machine/nvram.h"
-#include "cpu/h8/h83002.h"
+#include "machine/tmp68301.h"
+#include "sound/dac.h"
+#include "sound/3812intf.h"
+#include "sound/volt_reg.h"
+#include "video/v9938.h"
class csplayh5_state : public driver_device
@@ -43,8 +44,6 @@ public:
m_maincpu(*this, "maincpu"),
m_tmp68301(*this, "tmp68301"),
m_v9958(*this, "v9958"),
- m_dac1(*this, "dac1"),
- m_dac2(*this, "dac2"),
m_soundlatch(*this, "soundlatch"),
m_key(*this, "KEY.%u", 0),
m_region_maincpu(*this, "maincpu"),
@@ -55,8 +54,6 @@ public:
required_device<cpu_device> m_maincpu;
required_device<tmp68301_device> m_tmp68301;
required_device<v9958_device> m_v9958;
- required_device<dac_device> m_dac1;
- required_device<dac_device> m_dac2;
required_device<generic_latch_8_device> m_soundlatch;
required_ioport_array<5> m_key;
required_memory_region m_region_maincpu;
@@ -73,8 +70,6 @@ public:
DECLARE_READ8_MEMBER(soundcpu_portd_r);
DECLARE_WRITE8_MEMBER(soundcpu_porta_w);
- DECLARE_WRITE8_MEMBER(soundcpu_dac2_w);
- DECLARE_WRITE8_MEMBER(soundcpu_dac1_w);
DECLARE_WRITE8_MEMBER(soundcpu_porte_w);
DECLARE_DRIVER_INIT(mjmania);
@@ -175,13 +170,6 @@ sound HW is identical to Niyanpai
/* TMPZ84C011 PIO emulation */
-#define SIGNED_DAC 0 // 0:unsigned DAC, 1:signed DAC
-#if SIGNED_DAC
-#define DAC_WRITE write_signed8
-#else
-#define DAC_WRITE write_unsigned8
-#endif
-
void csplayh5_state::soundbank_w(int data)
{
m_bank1->set_base(m_region_audiocpu->base() + 0x08000 + (0x8000 * (data & 0x03)));
@@ -208,16 +196,6 @@ WRITE8_MEMBER(csplayh5_state::soundcpu_porta_w)
soundbank_w(data & 0x03);
}
-WRITE8_MEMBER(csplayh5_state::soundcpu_dac2_w)
-{
- m_dac2->DAC_WRITE(data);
-}
-
-WRITE8_MEMBER(csplayh5_state::soundcpu_dac1_w)
-{
- m_dac1->DAC_WRITE(data);
-}
-
WRITE8_MEMBER(csplayh5_state::soundcpu_porte_w)
{
if (!(data & 0x01)) csplayh5_soundclr_w(space, 0, 0);
@@ -472,8 +450,8 @@ static MACHINE_CONFIG_START( csplayh5, csplayh5_state )
MCFG_CPU_PROGRAM_MAP(csplayh5_sound_map)
MCFG_CPU_IO_MAP(csplayh5_sound_io_map)
MCFG_TMPZ84C011_PORTA_WRITE_CB(WRITE8(csplayh5_state, soundcpu_porta_w))
- MCFG_TMPZ84C011_PORTB_WRITE_CB(WRITE8(csplayh5_state, soundcpu_dac2_w))
- MCFG_TMPZ84C011_PORTC_WRITE_CB(WRITE8(csplayh5_state, soundcpu_dac1_w))
+ MCFG_TMPZ84C011_PORTB_WRITE_CB(DEVWRITE8("dac2", dac_byte_interface, write))
+ MCFG_TMPZ84C011_PORTC_WRITE_CB(DEVWRITE8("dac1", dac_byte_interface, write))
MCFG_TMPZ84C011_PORTD_READ_CB(READ8(csplayh5_state, soundcpu_portd_r))
MCFG_TMPZ84C011_PORTE_WRITE_CB(WRITE8(csplayh5_state, soundcpu_porte_w))
MCFG_TMPZ84C011_ZC0_CB(DEVWRITELINE("audiocpu", tmpz84c011_device, trg3))
@@ -486,19 +464,19 @@ static MACHINE_CONFIG_START( csplayh5, csplayh5_state )
MCFG_V99X8_SCREEN_ADD_NTSC("screen", "v9958", XTAL_21_4772MHz)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("ymsnd", YM3812, 4000000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.70)
-
- MCFG_DAC_ADD("dac1")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
-
- MCFG_DAC_ADD("dac2")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
-MACHINE_CONFIG_END
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.7)
+
+ MCFG_SOUND_ADD("dac1", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) // unknown DAC
+ MCFG_SOUND_ADD("dac2", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.375) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac1", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac1", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac2", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac2", -1.0, DAC_VREF_NEG_INPUT)
+ MACHINE_CONFIG_END
/***************************************************************************
diff --git a/src/mame/drivers/cubeqst.cpp b/src/mame/drivers/cubeqst.cpp
index 6c084f3b897..4f72111642b 100644
--- a/src/mame/drivers/cubeqst.cpp
+++ b/src/mame/drivers/cubeqst.cpp
@@ -20,12 +20,12 @@
****************************************************************************/
#include "emu.h"
-#include "cpu/m68000/m68000.h"
#include "cpu/cubeqcpu/cubeqcpu.h"
-#include "sound/dac.h"
+#include "cpu/m68000/m68000.h"
#include "machine/ldpr8210.h"
#include "machine/nvram.h"
-
+#include "sound/dac.h"
+#include "sound/volt_reg.h"
class cubeqst_state : public driver_device
{
@@ -37,6 +37,16 @@ public:
m_linecpu(*this, "line_cpu"),
m_soundcpu(*this, "sound_cpu"),
m_screen(*this, "screen"),
+ m_dacs(*this, {
+ "rdac0", "ldac0",
+ "rdac1", "ldac1",
+ "rdac2", "ldac2",
+ "rdac3", "ldac3",
+ "rdac4", "ldac4",
+ "rdac5", "ldac5",
+ "rdac6", "ldac6",
+ "rdac7", "ldac7"
+ }),
m_generic_paletteram_16(*this, "paletteram") { }
std::unique_ptr<UINT8[]> m_depth_buffer;
@@ -48,6 +58,7 @@ public:
required_device<cquestlin_cpu_device> m_linecpu;
required_device<cquestsnd_cpu_device> m_soundcpu;
required_device<screen_device> m_screen;
+ required_device_array<dac_word_interface, 16> m_dacs;
required_shared_ptr<UINT16> m_generic_paletteram_16;
std::unique_ptr<rgb_t[]> m_colormap;
DECLARE_WRITE16_MEMBER(palette_w);
@@ -485,18 +496,10 @@ void cubeqst_state::machine_reset()
/* Called by the sound CPU emulation */
WRITE16_MEMBER( cubeqst_state::sound_dac_w )
{
- static const char *const dacs[] =
- {
- "rdac0", "ldac0",
- "rdac1", "ldac1",
- "rdac2", "ldac2",
- "rdac3", "ldac3",
- "rdac4", "ldac4",
- "rdac5", "ldac5",
- "rdac6", "ldac6",
- "rdac7", "ldac7"
- };
- machine().device<dac_device>(dacs[data & 15])->write_signed16((data & 0xfff0) ^ 0x8000);
+ /// d0 selects between 4051.1d (right, d0=1) and 4051.3d (left, d0=0)
+ /// d1-d3 select the channel
+ /// d4-d11 are sent to the 7521 dac, d11 is inverted
+ m_dacs[data & 15]->write((data >> 4) ^ 0x800);
}
@@ -542,38 +545,39 @@ static MACHINE_CONFIG_START( cubeqst, cubeqst_state )
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
- MCFG_DAC_ADD("rdac0")
- MCFG_SOUND_ROUTE(0, "rspeaker", 0.125)
- MCFG_DAC_ADD("ldac0")
- MCFG_SOUND_ROUTE(0, "lspeaker", 0.125)
- MCFG_DAC_ADD("rdac1")
- MCFG_SOUND_ROUTE(0, "rspeaker", 0.125)
- MCFG_DAC_ADD("ldac1")
- MCFG_SOUND_ROUTE(0, "lspeaker", 0.125)
- MCFG_DAC_ADD("rdac2")
- MCFG_SOUND_ROUTE(0, "rspeaker", 0.125)
- MCFG_DAC_ADD("ldac2")
- MCFG_SOUND_ROUTE(0, "lspeaker", 0.125)
- MCFG_DAC_ADD("rdac3")
- MCFG_SOUND_ROUTE(0, "rspeaker", 0.125)
- MCFG_DAC_ADD("ldac3")
- MCFG_SOUND_ROUTE(0, "lspeaker", 0.125)
- MCFG_DAC_ADD("rdac4")
- MCFG_SOUND_ROUTE(0, "rspeaker", 0.125)
- MCFG_DAC_ADD("ldac4")
- MCFG_SOUND_ROUTE(0, "lspeaker", 0.125)
- MCFG_DAC_ADD("rdac5")
- MCFG_SOUND_ROUTE(0, "rspeaker", 0.125)
- MCFG_DAC_ADD("ldac5")
- MCFG_SOUND_ROUTE(0, "lspeaker", 0.125)
- MCFG_DAC_ADD("rdac6")
- MCFG_SOUND_ROUTE(0, "rspeaker", 0.125)
- MCFG_DAC_ADD("ldac6")
- MCFG_SOUND_ROUTE(0, "lspeaker", 0.125)
- MCFG_DAC_ADD("rdac7")
- MCFG_SOUND_ROUTE(0, "rspeaker", 0.125)
- MCFG_DAC_ADD("ldac7")
- MCFG_SOUND_ROUTE(0, "lspeaker", 0.125)
+ MCFG_SOUND_ADD("rdac0", AD7521, 0) MCFG_SOUND_ROUTE(0, "rspeaker", 0.125) // ad7521jn.2d (59) + cd4051be.1d (24) + 1500pf.c22 (34) + tl074cn.1b (53) + r10k.rn1 (30)
+ MCFG_SOUND_ADD("ldac0", AD7521, 0) MCFG_SOUND_ROUTE(0, "lspeaker", 0.125) // ad7521jn.2d (59) + cd4051be.3d (24) + 1500pf.c13 (34) + tl074cn.3b (53) + r10k.rn3 (30)
+ MCFG_SOUND_ADD("rdac1", AD7521, 0) MCFG_SOUND_ROUTE(0, "rspeaker", 0.125) // ad7521jn.2d (59) + cd4051be.1d (24) + 1500pf.c21 (34) + tl074cn.1c (53) + r10k.rn2 (30)
+ MCFG_SOUND_ADD("ldac1", AD7521, 0) MCFG_SOUND_ROUTE(0, "lspeaker", 0.125) // ad7521jn.2d (59) + cd4051be.3d (24) + 1500pf.c12 (34) + tl074cn.3c (53) + r10k.rn4 (30)
+ MCFG_SOUND_ADD("rdac2", AD7521, 0) MCFG_SOUND_ROUTE(0, "rspeaker", 0.125) // ad7521jn.2d (59) + cd4051be.1d (24) + 1500pf.c20 (34) + tl074cn.1c (53) + r10k.rn2 (30)
+ MCFG_SOUND_ADD("ldac2", AD7521, 0) MCFG_SOUND_ROUTE(0, "lspeaker", 0.125) // ad7521jn.2d (59) + cd4051be.3d (24) + 1500pf.c11 (34) + tl074cn.3c (53) + r10k.rn4 (30)
+ MCFG_SOUND_ADD("rdac3", AD7521, 0) MCFG_SOUND_ROUTE(0, "rspeaker", 0.125) // ad7521jn.2d (59) + cd4051be.1d (24) + 1500pf.c19 (34) + tl074cn.1b (53) + r10k.rn1 (30)
+ MCFG_SOUND_ADD("ldac3", AD7521, 0) MCFG_SOUND_ROUTE(0, "lspeaker", 0.125) // ad7521jn.2d (59) + cd4051be.3d (24) + 1500pf.c10 (34) + tl074cn.3b (53) + r10k.rn3 (30)
+ MCFG_SOUND_ADD("rdac4", AD7521, 0) MCFG_SOUND_ROUTE(0, "rspeaker", 0.125) // ad7521jn.2d (59) + cd4051be.1d (24) + 1500pf.c18 (34) + tl074cn.1c (53) + r10k.rn2 (30)
+ MCFG_SOUND_ADD("ldac4", AD7521, 0) MCFG_SOUND_ROUTE(0, "lspeaker", 0.125) // ad7521jn.2d (59) + cd4051be.3d (24) + 1500pf.c9 (34) + tl074cn.3c (53) + r10k.rn4 (30)
+ MCFG_SOUND_ADD("rdac5", AD7521, 0) MCFG_SOUND_ROUTE(0, "rspeaker", 0.125) // ad7521jn.2d (59) + cd4051be.1d (24) + 1500pf.c17 (34) + tl074cn.1b (53) + r10k.rn1 (30)
+ MCFG_SOUND_ADD("ldac5", AD7521, 0) MCFG_SOUND_ROUTE(0, "lspeaker", 0.125) // ad7521jn.2d (59) + cd4051be.3d (24) + 1500pf.c8 (34) + tl074cn.3b (53) + r10k.rn3 (30)
+ MCFG_SOUND_ADD("rdac6", AD7521, 0) MCFG_SOUND_ROUTE(0, "rspeaker", 0.125) // ad7521jn.2d (59) + cd4051be.1d (24) + 1500pf.c16 (34) + tl074cn.1c (53) + r10k.rn2 (30)
+ MCFG_SOUND_ADD("ldac6", AD7521, 0) MCFG_SOUND_ROUTE(0, "lspeaker", 0.125) // ad7521jn.2d (59) + cd4051be.3d (24) + 1500pf.c7 (34) + tl074cn.3c (53) + r10k.rn4 (30)
+ MCFG_SOUND_ADD("rdac7", AD7521, 0) MCFG_SOUND_ROUTE(0, "rspeaker", 0.125) // ad7521jn.2d (59) + cd4051be.1d (24) + 1500pf.c15 (34) + tl074cn.1b (53) + r10k.rn1 (30)
+ MCFG_SOUND_ADD("ldac7", AD7521, 0) MCFG_SOUND_ROUTE(0, "lspeaker", 0.125) // ad7521jn.2d (59) + cd4051be.3d (24) + 1500pf.c6 (34) + tl074cn.3b (53) + r10k.rn3 (30)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "rdac0", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "rdac0", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "ldac0", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "ldac0", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "rdac1", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "rdac1", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "ldac1", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "ldac1", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "rdac2", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "rdac2", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "ldac2", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "ldac2", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "rdac3", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "rdac3", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "ldac3", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "ldac3", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "rdac4", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "rdac4", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "ldac4", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "ldac4", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "rdac5", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "rdac5", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "ldac5", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "ldac5", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "rdac6", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "rdac6", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "ldac6", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "ldac6", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "rdac7", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "rdac7", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "ldac7", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "ldac7", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/cvs.cpp b/src/mame/drivers/cvs.cpp
index ee26f242769..5ff7e05dbe0 100644
--- a/src/mame/drivers/cvs.cpp
+++ b/src/mame/drivers/cvs.cpp
@@ -93,8 +93,9 @@ Todo & FIXME:
***************************************************************************/
#include "emu.h"
-#include "cpu/s2650/s2650.h"
#include "includes/cvs.h"
+#include "cpu/s2650/s2650.h"
+#include "sound/volt_reg.h"
/* Turn to 1 so all inputs are always available (this shall only be a debug feature) */
@@ -294,7 +295,7 @@ TIMER_CALLBACK_MEMBER(cvs_state::cvs_393hz_timer_cb)
if (m_dac3 != nullptr)
{
if (m_dac3_state[2])
- m_dac3->write_unsigned8(m_cvs_393hz_clock * 0xff);
+ m_dac3->write(m_cvs_393hz_clock);
}
}
@@ -331,8 +332,8 @@ WRITE8_MEMBER(cvs_state::cvs_4_bit_dac_data_w)
(m_cvs_4_bit_dac_data[2] << 2) |
(m_cvs_4_bit_dac_data[3] << 3);
- /* scale up to a full byte and output */
- m_dac2->write_unsigned8((dac_value << 4) | dac_value);
+ /* output */
+ m_dac2->write(dac_value);
}
WRITE8_MEMBER(cvs_state::cvs_unknown_w)
@@ -478,7 +479,7 @@ static ADDRESS_MAP_START( cvs_dac_cpu_map, AS_PROGRAM, 8, cvs_state )
AM_RANGE(0x0000, 0x0fff) AM_ROM
AM_RANGE(0x1000, 0x107f) AM_RAM
AM_RANGE(0x1800, 0x1800) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
- AM_RANGE(0x1840, 0x1840) AM_DEVWRITE("dac1", dac_device, write_unsigned8)
+ AM_RANGE(0x1840, 0x1840) AM_DEVWRITE("dac1", dac_byte_interface, write)
AM_RANGE(0x1880, 0x1883) AM_WRITE(cvs_4_bit_dac_data_w) AM_SHARE("4bit_dac")
AM_RANGE(0x1884, 0x1887) AM_WRITE(cvs_unknown_w) AM_SHARE("dac3_state") /* ???? not connected to anything */
ADDRESS_MAP_END
@@ -1020,25 +1021,21 @@ static MACHINE_CONFIG_START( cvs, cvs_state )
MCFG_S2636_OFFSETS(CVS_S2636_Y_OFFSET, CVS_S2636_X_OFFSET)
/* audio hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_DAC_ADD("dac1")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
-
- //MCFG_DAC_ADD("dac1a")
- //MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
-
- MCFG_DAC_ADD("dac2")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
-
- MCFG_DAC_ADD("dac3")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ADD("dac1", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) // unknown DAC
+ MCFG_SOUND_ADD("dac2", DAC_4BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) // unknown DAC
+ MCFG_SOUND_ADD("dac3", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.99)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac1", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac1", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac2", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac2", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac3", 1.0, DAC_VREF_POS_INPUT)
MCFG_SOUND_ADD("tms", TMS5100, XTAL_640kHz)
MCFG_TMS5110_DATA_CB(READLINE(cvs_state, speech_rom_read_bit))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/cyberbal.cpp b/src/mame/drivers/cyberbal.cpp
index 6798d43c693..bbcb02505aa 100644
--- a/src/mame/drivers/cyberbal.cpp
+++ b/src/mame/drivers/cyberbal.cpp
@@ -22,10 +22,11 @@
#include "emu.h"
+#include "includes/cyberbal.h"
#include "machine/watchdog.h"
#include "sound/ym2151.h"
+#include "sound/volt_reg.h"
#include "rendlay.h"
-#include "includes/cyberbal.h"
/*************************************
@@ -463,11 +464,11 @@ static MACHINE_CONFIG_START( cyberbal, cyberbal_state )
MCFG_SOUND_ROUTE(0, "lspeaker", 0.60)
MCFG_SOUND_ROUTE(1, "rspeaker", 0.60)
- MCFG_DAC_ADD("dac1")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
-
- MCFG_DAC_ADD("dac2")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
+ MCFG_SOUND_ADD("rdac", AM6012, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.5) // AM6012.6j
+ MCFG_SOUND_ADD("ldac", AM6012, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.5) // AM6012.6j
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "rdac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "rdac", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "ldac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "ldac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/dacholer.cpp b/src/mame/drivers/dacholer.cpp
index 77bdacd178d..7f0fbba2064 100644
--- a/src/mame/drivers/dacholer.cpp
+++ b/src/mame/drivers/dacholer.cpp
@@ -35,7 +35,6 @@
#include "emu.h"
#include "cpu/z80/z80.h"
#include "machine/gen_latch.h"
-#include "sound/dac.h"
#include "sound/msm5205.h"
#include "sound/ay8910.h"
#include "video/resnet.h"
diff --git a/src/mame/drivers/dambustr.cpp b/src/mame/drivers/dambustr.cpp
index d6b2032b695..28a83d5231a 100644
--- a/src/mame/drivers/dambustr.cpp
+++ b/src/mame/drivers/dambustr.cpp
@@ -282,7 +282,7 @@ static MACHINE_CONFIG_START( dambustr, dambustr_state )
MCFG_VIDEO_START_OVERRIDE(dambustr_state,dambustr)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_FRAGMENT_ADD(galaxian_audio)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/dectalk.cpp b/src/mame/drivers/dectalk.cpp
index 1bf72ecced5..dcff714c654 100644
--- a/src/mame/drivers/dectalk.cpp
+++ b/src/mame/drivers/dectalk.cpp
@@ -265,6 +265,7 @@ dgc (dg(no!spam)cx@mac.com)
#include "machine/mc68681.h"
#include "machine/x2212.h"
#include "sound/dac.h"
+#include "sound/volt_reg.h"
class dectalk_state : public driver_device
@@ -311,7 +312,7 @@ public:
required_device<cpu_device> m_dsp;
required_device<mc68681_device> m_duart;
required_device<x2212_device> m_nvram;
- required_device<dac_device> m_dac;
+ required_device<dac_word_interface> m_dac;
DECLARE_WRITE_LINE_MEMBER(dectalk_duart_irq_handler);
DECLARE_WRITE_LINE_MEMBER(dectalk_duart_txa);
DECLARE_READ8_MEMBER(dectalk_duart_input);
@@ -843,7 +844,7 @@ TIMER_CALLBACK_MEMBER(dectalk_state::outfifo_read_cb)
if (data!= 0x8000) logerror("sample output: %04X\n", data);
#endif
timer_set(attotime::from_hz(10000), TIMER_OUTFIFO_READ);
- m_dac->write_signed16(data);
+ m_dac->write(data >> 4);
// hack for break key, requires hacked up duart core so disabled for now
// also it doesn't work well, the setup menu is badly corrupt
/*device_t *duart = machine().device("duartn68681");
@@ -888,9 +889,10 @@ static MACHINE_CONFIG_START( dectalk, dectalk_state )
/* video hardware */
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("dac", DAC, 0) /* E88 10KHz OSC, handled by timer */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.9)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", AD7541, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.9) // ad7541.e107 (E88 10KHz OSC, handled by timer)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
/* Y2 is a 3.579545 MHz xtal for the dtmf decoder chip */
diff --git a/src/mame/drivers/dragon.cpp b/src/mame/drivers/dragon.cpp
index 52949b17816..1151c6c28bd 100644
--- a/src/mame/drivers/dragon.cpp
+++ b/src/mame/drivers/dragon.cpp
@@ -258,7 +258,7 @@ static MACHINE_CONFIG_DERIVED_CLASS( dgnalpha, dragon_base, dragon_alpha_state )
MCFG_SOUND_ADD(AY8912_TAG, AY8912, 1000000)
MCFG_AY8910_PORT_A_READ_CB(READ8(dragon_alpha_state, psg_porta_read))
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(dragon_alpha_state, psg_porta_write))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.75)
// pia 2
MCFG_DEVICE_ADD( PIA2_TAG, PIA6821, 0)
diff --git a/src/mame/drivers/equites.cpp b/src/mame/drivers/equites.cpp
index 71455d4e7c6..a048457d02b 100644
--- a/src/mame/drivers/equites.cpp
+++ b/src/mame/drivers/equites.cpp
@@ -356,13 +356,14 @@ D
*******************************************************************************/
#include "emu.h"
-#include "cpu/m68000/m68000.h"
+#include "includes/equites.h"
#include "cpu/alph8201/alph8201.h"
#include "cpu/i8085/i8085.h"
-#include "sound/ay8910.h"
+#include "cpu/m68000/m68000.h"
#include "machine/nvram.h"
#include "machine/watchdog.h"
-#include "includes/equites.h"
+#include "sound/ay8910.h"
+#include "sound/volt_reg.h"
#define FRQ_ADJUSTER_TAG "FRQ"
@@ -500,15 +501,15 @@ void equites_state::equites_update_dac( )
// Note that PB0 goes through three filters while PB1 only goes through one.
if (m_eq8155_port_b & 1)
- m_dac_1->write_signed8(m_dac_latch);
+ m_dac_1->write(m_dac_latch);
if (m_eq8155_port_b & 2)
- m_dac_2->write_signed8(m_dac_latch);
+ m_dac_2->write(m_dac_latch);
}
WRITE8_MEMBER(equites_state::equites_dac_latch_w)
{
- m_dac_latch = data << 2;
+ m_dac_latch = data;
equites_update_dac();
}
@@ -1051,40 +1052,40 @@ static MACHINE_CONFIG_FRAGMENT( common_sound )
MCFG_CPU_IO_MAP(sound_portmap)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("msm", MSM5232, MSM5232_MAX_CLOCK) // will be adjusted at runtime through PORT_ADJUSTER
MCFG_MSM5232_SET_CAPACITORS(0.47e-6, 0.47e-6, 0.47e-6, 0.47e-6, 0.47e-6, 0.47e-6, 0.47e-6, 0.47e-6) // verified
MCFG_MSM5232_GATE_HANDLER_CB(WRITELINE(equites_state, equites_msm5232_gate))
- MCFG_SOUND_ROUTE(0, "mono", MSM5232_BASE_VOLUME/2.2) // pin 28 2'-1 : 22k resistor
- MCFG_SOUND_ROUTE(1, "mono", MSM5232_BASE_VOLUME/1.5) // pin 29 4'-1 : 15k resistor
- MCFG_SOUND_ROUTE(2, "mono", MSM5232_BASE_VOLUME) // pin 30 8'-1 : 10k resistor
- MCFG_SOUND_ROUTE(3, "mono", MSM5232_BASE_VOLUME) // pin 31 16'-1 : 10k resistor
- MCFG_SOUND_ROUTE(4, "mono", MSM5232_BASE_VOLUME/2.2) // pin 36 2'-2 : 22k resistor
- MCFG_SOUND_ROUTE(5, "mono", MSM5232_BASE_VOLUME/1.5) // pin 35 4'-2 : 15k resistor
- MCFG_SOUND_ROUTE(6, "mono", MSM5232_BASE_VOLUME) // pin 34 8'-2 : 10k resistor
- MCFG_SOUND_ROUTE(7, "mono", MSM5232_BASE_VOLUME) // pin 33 16'-2 : 10k resistor
- MCFG_SOUND_ROUTE(8, "mono", 1.0) // pin 1 SOLO 8' (this actually feeds an analog section)
- MCFG_SOUND_ROUTE(9, "mono", 1.0) // pin 2 SOLO 16' (this actually feeds an analog section)
- MCFG_SOUND_ROUTE(10,"mono", 0.12) // pin 22 Noise Output (this actually feeds an analog section)
+ MCFG_SOUND_ROUTE(0, "speaker", MSM5232_BASE_VOLUME/2.2) // pin 28 2'-1 : 22k resistor
+ MCFG_SOUND_ROUTE(1, "speaker", MSM5232_BASE_VOLUME/1.5) // pin 29 4'-1 : 15k resistor
+ MCFG_SOUND_ROUTE(2, "speaker", MSM5232_BASE_VOLUME) // pin 30 8'-1 : 10k resistor
+ MCFG_SOUND_ROUTE(3, "speaker", MSM5232_BASE_VOLUME) // pin 31 16'-1 : 10k resistor
+ MCFG_SOUND_ROUTE(4, "speaker", MSM5232_BASE_VOLUME/2.2) // pin 36 2'-2 : 22k resistor
+ MCFG_SOUND_ROUTE(5, "speaker", MSM5232_BASE_VOLUME/1.5) // pin 35 4'-2 : 15k resistor
+ MCFG_SOUND_ROUTE(6, "speaker", MSM5232_BASE_VOLUME) // pin 34 8'-2 : 10k resistor
+ MCFG_SOUND_ROUTE(7, "speaker", MSM5232_BASE_VOLUME) // pin 33 16'-2 : 10k resistor
+ MCFG_SOUND_ROUTE(8, "speaker", 1.0) // pin 1 SOLO 8' (this actually feeds an analog section)
+ MCFG_SOUND_ROUTE(9, "speaker", 1.0) // pin 2 SOLO 16' (this actually feeds an analog section)
+ MCFG_SOUND_ROUTE(10,"speaker", 0.12) // pin 22 Noise Output (this actually feeds an analog section)
MCFG_SOUND_ADD("aysnd", AY8910, XTAL_6_144MHz/4) /* verified on pcb */
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(equites_state, equites_8910porta_w))
MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(equites_state, equites_8910portb_w))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.15)
-
- MCFG_DAC_ADD("dac1")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.15)
- MCFG_DAC_ADD("dac2")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ADD("dac1", DAC_6BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) // unknown DAC
+ MCFG_SOUND_ADD("dac2", DAC_6BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac1", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac1", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac2", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac2", -1.0, DAC_VREF_NEG_INPUT)
MCFG_SOUND_ADD("samples", SAMPLES, 0)
MCFG_SAMPLES_CHANNELS(3)
MCFG_SAMPLES_NAMES(alphamc07_sample_names)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.3)
MACHINE_CONFIG_END
/******************************************************************************/
diff --git a/src/mame/drivers/ertictac.cpp b/src/mame/drivers/ertictac.cpp
index e3723ee91cd..3723698acd8 100644
--- a/src/mame/drivers/ertictac.cpp
+++ b/src/mame/drivers/ertictac.cpp
@@ -24,11 +24,11 @@ PCB has a single OSC at 24MHz
*******************************************************************************************/
#include "emu.h"
-#include "cpu/arm/arm.h"
-#include "sound/dac.h"
#include "includes/archimds.h"
-#include "machine/i2cmem.h"
+#include "cpu/arm/arm.h"
#include "machine/aakart.h"
+#include "machine/i2cmem.h"
+#include "sound/volt_reg.h"
class ertictac_state : public archimedes_state
@@ -202,9 +202,6 @@ DRIVER_INIT_MEMBER(ertictac_state,ertictac)
void ertictac_state::machine_start()
{
archimedes_init();
-
- // reset the DAC to centerline
- //m_dac->write_signed8(0x80);
}
void ertictac_state::machine_reset()
@@ -241,30 +238,24 @@ static MACHINE_CONFIG_START( ertictac, ertictac_state )
MCFG_PALETTE_ADD("palette", 0x200)
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DAC_ADD("dac0")
- MCFG_SOUND_ROUTE(0, "mono", 0.05)
-
- MCFG_DAC_ADD("dac1")
- MCFG_SOUND_ROUTE(0, "mono", 0.05)
-
- MCFG_DAC_ADD("dac2")
- MCFG_SOUND_ROUTE(0, "mono", 0.05)
-
- MCFG_DAC_ADD("dac3")
- MCFG_SOUND_ROUTE(0, "mono", 0.05)
-
- MCFG_DAC_ADD("dac4")
- MCFG_SOUND_ROUTE(0, "mono", 0.05)
-
- MCFG_DAC_ADD("dac5")
- MCFG_SOUND_ROUTE(0, "mono", 0.05)
-
- MCFG_DAC_ADD("dac6")
- MCFG_SOUND_ROUTE(0, "mono", 0.05)
-
- MCFG_DAC_ADD("dac7")
- MCFG_SOUND_ROUTE(0, "mono", 0.05)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac0", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(0, "speaker", 0.05) // unknown DAC
+ MCFG_SOUND_ADD("dac1", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(0, "speaker", 0.05) // unknown DAC
+ MCFG_SOUND_ADD("dac2", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(0, "speaker", 0.05) // unknown DAC
+ MCFG_SOUND_ADD("dac3", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(0, "speaker", 0.05) // unknown DAC
+ MCFG_SOUND_ADD("dac4", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(0, "speaker", 0.05) // unknown DAC
+ MCFG_SOUND_ADD("dac5", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(0, "speaker", 0.05) // unknown DAC
+ MCFG_SOUND_ADD("dac6", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(0, "speaker", 0.05) // unknown DAC
+ MCFG_SOUND_ADD("dac7", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(0, "speaker", 0.05) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac0", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac0", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac1", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac1", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac2", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac2", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac3", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac3", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac4", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac4", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac5", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac5", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac6", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac6", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac7", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac7", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
ROM_START( ertictac )
diff --git a/src/mame/drivers/esripsys.cpp b/src/mame/drivers/esripsys.cpp
index 81683144df5..bf62a7e04fc 100644
--- a/src/mame/drivers/esripsys.cpp
+++ b/src/mame/drivers/esripsys.cpp
@@ -27,12 +27,12 @@
****************************************************************************/
#include "emu.h"
-#include "cpu/m6809/m6809.h"
+#include "includes/esripsys.h"
#include "cpu/esrip/esrip.h"
+#include "cpu/m6809/m6809.h"
#include "machine/6840ptm.h"
#include "machine/nvram.h"
-#include "sound/dac.h"
-#include "includes/esripsys.h"
+#include "sound/volt_reg.h"
/*************************************
@@ -552,22 +552,10 @@ WRITE8_MEMBER(esripsys_state::esripsys_dac_w)
else
{
UINT16 dac_data = (m_dac_msb << 8) | data;
-
- /*
- The 8-bit DAC modulates the 10-bit DAC.
- Shift down to prevent clipping.
- */
- m_dac->write_signed16((m_dac_vol * dac_data) >> 1);
+ m_dac->write(dac_data);
}
}
-/* 8-bit MC3408 DAC */
-WRITE8_MEMBER(esripsys_state::volume_dac_w)
-{
- m_dac_vol = data;
-}
-
-
/*************************************
*
* Memory Maps
@@ -603,7 +591,7 @@ static ADDRESS_MAP_START( sound_cpu_map, AS_PROGRAM, 8, esripsys_state )
AM_RANGE(0x0800, 0x0fff) AM_RAM // Not installed on later PCBs
AM_RANGE(0x2008, 0x2009) AM_READWRITE(tms5220_r, tms5220_w)
AM_RANGE(0x200a, 0x200b) AM_WRITE(esripsys_dac_w)
- AM_RANGE(0x200c, 0x200c) AM_WRITE(volume_dac_w)
+ AM_RANGE(0x200c, 0x200c) AM_DEVWRITE("dacvol", dac_byte_interface, write)
AM_RANGE(0x200d, 0x200d) AM_WRITE(control_w)
AM_RANGE(0x200e, 0x200e) AM_READWRITE(s_200e_r, s_200e_w)
AM_RANGE(0x200f, 0x200f) AM_READWRITE(s_200f_r, s_200f_w)
@@ -662,7 +650,6 @@ DRIVER_INIT_MEMBER(esripsys_state,esripsys)
save_item(NAME(m_s_to_g_latch1));
save_item(NAME(m_s_to_g_latch2));
save_item(NAME(m_dac_msb));
- save_item(NAME(m_dac_vol));
save_item(NAME(m_tms_data));
m_fasel = 0;
@@ -700,13 +687,16 @@ static MACHINE_CONFIG_START( esripsys, esripsys_state )
MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_ALWAYS_UPDATE)
/* Sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ADD("dac", MC3410, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0) // unknown DAC
+ MCFG_SOUND_ADD("dacvol", MC3408, 0) // unknown DAC
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dacvol", 1.0, DAC_VREF_POS_INPUT)
MCFG_SOUND_ADD("tms5220nl", TMS5220, 640000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
/* 6840 PTM */
MCFG_DEVICE_ADD("6840ptm", PTM6840, 0)
diff --git a/src/mame/drivers/exterm.cpp b/src/mame/drivers/exterm.cpp
index 0db0060e437..ec8dfdcc9fc 100644
--- a/src/mame/drivers/exterm.cpp
+++ b/src/mame/drivers/exterm.cpp
@@ -63,13 +63,13 @@
****************************************************************************/
#include "emu.h"
-#include "cpu/tms34010/tms34010.h"
+#include "includes/exterm.h"
#include "cpu/m6502/m6502.h"
-#include "sound/dac.h"
-#include "sound/ym2151.h"
#include "machine/nvram.h"
#include "machine/watchdog.h"
-#include "includes/exterm.h"
+#include "sound/dac.h"
+#include "sound/volt_reg.h"
+#include "sound/ym2151.h"
@@ -238,14 +238,6 @@ READ8_MEMBER(exterm_state::sound_slave_latch_r)
}
-WRITE8_MEMBER(exterm_state::sound_slave_dac_w)
-{
- /* DAC A is used to modulate DAC B */
- m_dac_value[offset & 1] = data;
- m_dac->write_unsigned16((m_dac_value[0] ^ 0xff) * m_dac_value[1]);
-}
-
-
READ8_MEMBER(exterm_state::sound_nmi_to_slave_r)
{
/* a read from here triggers an NMI pulse to the slave */
@@ -320,7 +312,8 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( sound_slave_map, AS_PROGRAM, 8, exterm_state )
AM_RANGE(0x0000, 0x07ff) AM_MIRROR(0x3800) AM_RAM
AM_RANGE(0x4000, 0x5fff) AM_READ(sound_slave_latch_r)
- AM_RANGE(0x8000, 0xbfff) AM_WRITE(sound_slave_dac_w)
+ AM_RANGE(0x8000, 0x8000) AM_MIRROR(0x3ffe) AM_DEVWRITE("dacvol", dac_byte_interface, write)
+ AM_RANGE(0x8001, 0x8001) AM_MIRROR(0x3ffe) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(0x8000, 0xffff) AM_ROM
ADDRESS_MAP_END
@@ -447,13 +440,16 @@ static MACHINE_CONFIG_START( exterm, exterm_state )
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
+ MCFG_SOUND_ADD("dac", AD7528, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.4) // ad7528j.e2
+ MCFG_SOUND_ADD("dacvol", AD7528, 0) // ad7528j.e2
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dacvol", 1.0, DAC_VREF_POS_INPUT)
MCFG_YM2151_ADD("ymsnd", 4000000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/famibox.cpp b/src/mame/drivers/famibox.cpp
index ce62e04be0d..8645b119da1 100644
--- a/src/mame/drivers/famibox.cpp
+++ b/src/mame/drivers/famibox.cpp
@@ -62,7 +62,6 @@ Notes/ToDo:
#include "emu.h"
#include "video/ppu2c0x.h"
#include "cpu/m6502/n2a03.h"
-#include "sound/dac.h"
#include "debugger.h"
diff --git a/src/mame/drivers/fantland.cpp b/src/mame/drivers/fantland.cpp
index 06f807891a5..b175a144897 100644
--- a/src/mame/drivers/fantland.cpp
+++ b/src/mame/drivers/fantland.cpp
@@ -46,13 +46,14 @@ Year + Game Main CPU Sound CPU Sound Video
***************************************************************************************/
#include "emu.h"
-#include "cpu/z80/z80.h"
-#include "cpu/nec/nec.h"
+#include "includes/fantland.h"
#include "cpu/i86/i86.h"
-#include "sound/ym2151.h"
+#include "cpu/nec/nec.h"
+#include "cpu/z80/z80.h"
#include "sound/3526intf.h"
#include "sound/dac.h"
-#include "includes/fantland.h"
+#include "sound/volt_reg.h"
+#include "sound/ym2151.h"
/***************************************************************************
@@ -295,7 +296,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( fantland_sound_iomap, AS_IO, 8, fantland_state )
AM_RANGE( 0x0080, 0x0080 ) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE( 0x0100, 0x0101 ) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
- AM_RANGE( 0x0180, 0x0180 ) AM_DEVWRITE("dac", dac_device, write_unsigned8 )
+ AM_RANGE( 0x0180, 0x0180 ) AM_DEVWRITE("dac", dac_byte_interface, write )
ADDRESS_MAP_END
static ADDRESS_MAP_START( galaxygn_sound_iomap, AS_IO, 8, fantland_state )
@@ -867,16 +868,17 @@ static MACHINE_CONFIG_START( fantland, fantland_state )
MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_YM2151_ADD("ymsnd", 3000000)
- MCFG_SOUND_ROUTE(0, "mono", 0.35)
- MCFG_SOUND_ROUTE(1, "mono", 0.35)
+ MCFG_SOUND_ROUTE(0, "speaker", 0.35)
+ MCFG_SOUND_ROUTE(1, "speaker", 0.35)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
@@ -914,14 +916,14 @@ static MACHINE_CONFIG_START( galaxygn, fantland_state )
MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_YM2151_ADD("ymsnd", 3000000)
MCFG_YM2151_IRQ_HANDLER(WRITELINE(fantland_state, galaxygn_sound_irq))
- MCFG_SOUND_ROUTE(0, "mono", 1.0)
- MCFG_SOUND_ROUTE(1, "mono", 1.0)
+ MCFG_SOUND_ROUTE(0, "speaker", 1.0)
+ MCFG_SOUND_ROUTE(1, "speaker", 1.0)
MACHINE_CONFIG_END
@@ -994,7 +996,7 @@ static MACHINE_CONFIG_START( borntofi, fantland_state )
MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
@@ -1002,22 +1004,22 @@ static MACHINE_CONFIG_START( borntofi, fantland_state )
MCFG_SOUND_ADD("msm1", MSM5205, 384000)
MCFG_MSM5205_VCLK_CB(WRITELINE(fantland_state, borntofi_adpcm_int_0)) /* IRQ handler */
MCFG_MSM5205_PRESCALER_SELECTOR(MSM5205_S48_4B) /* 8 kHz, 4 Bits */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MCFG_SOUND_ADD("msm2", MSM5205, 384000)
MCFG_MSM5205_VCLK_CB(WRITELINE(fantland_state, borntofi_adpcm_int_1)) /* IRQ handler */
MCFG_MSM5205_PRESCALER_SELECTOR(MSM5205_S48_4B) /* 8 kHz, 4 Bits */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MCFG_SOUND_ADD("msm3", MSM5205, 384000)
MCFG_MSM5205_VCLK_CB(WRITELINE(fantland_state, borntofi_adpcm_int_2)) /* IRQ handler */
MCFG_MSM5205_PRESCALER_SELECTOR(MSM5205_S48_4B) /* 8 kHz, 4 Bits */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MCFG_SOUND_ADD("msm4", MSM5205, 384000)
MCFG_MSM5205_VCLK_CB(WRITELINE(fantland_state, borntofi_adpcm_int_3)) /* IRQ handler */
MCFG_MSM5205_PRESCALER_SELECTOR(MSM5205_S48_4B) /* 8 kHz, 4 Bits */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
@@ -1049,13 +1051,13 @@ static MACHINE_CONFIG_START( wheelrun, fantland_state )
MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("ymsnd", YM3526, XTAL_14MHz/4)
MCFG_YM3526_IRQ_HANDLER(INPUTLINE("audiocpu", INPUT_LINE_IRQ0))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/fidel6502.cpp b/src/mame/drivers/fidel6502.cpp
index f61f0b14743..178420199ac 100644
--- a/src/mame/drivers/fidel6502.cpp
+++ b/src/mame/drivers/fidel6502.cpp
@@ -380,15 +380,14 @@ I/O is via TTL, see source code for more info
******************************************************************************/
#include "emu.h"
+#include "includes/fidelz80.h"
#include "cpu/m6502/m6502.h"
#include "cpu/m6502/r65c02.h"
#include "cpu/m6502/m65sc02.h"
#include "machine/6821pia.h"
#include "machine/i8255.h"
#include "machine/nvram.h"
-#include "sound/dac.h"
-
-#include "includes/fidelz80.h"
+#include "sound/volt_reg.h"
// internal artwork
#include "fidel_chesster.lh" // clickable
@@ -485,7 +484,7 @@ void fidel6502_state::csc_prepare_display()
m_inp_mux = 1 << m_led_select & 0x3ff;
// 7442 9: speaker out
- m_speaker->level_w(m_inp_mux >> 9 & 1);
+ m_dac->write(BIT(m_inp_mux, 9));
// 7seg leds+H (not on all models), 8*8(+1) chessboard leds
set_display_segmask(0xf, 0x7f);
@@ -655,7 +654,7 @@ WRITE8_MEMBER(fidel6502_state::eas_ppi_portc_w)
eas_prepare_display();
// 7442 9: speaker out
- m_speaker->level_w(m_led_select >> 9 & 1);
+ m_dac->write(BIT(m_led_select, 9));
// d4: speech ROM A12
m_speech->force_update(); // update stream to now
@@ -708,7 +707,7 @@ WRITE8_MEMBER(fidel6502_state::sc9_control_w)
sc9_prepare_display();
// 74245 Q9: speaker out
- m_speaker->level_w(sel >> 9 & 1);
+ m_dac->write(BIT(sel, 9));
// d4,d5: ?
// d6,d7: N/C
@@ -743,7 +742,7 @@ WRITE8_MEMBER(fidel6502_state::sc12_control_w)
m_inp_mux = sel & 0x1ff;
// 7442 9: speaker out
- m_speaker->level_w(sel >> 9 & 1);
+ m_dac->write(BIT(sel, 9));
// d6,d7: led select (active low)
display_matrix(9, 2, sel & 0x1ff, ~data >> 6 & 3);
@@ -804,7 +803,7 @@ WRITE8_MEMBER(fidel6502_state::fexcel_ttl_w)
m_inp_mux = sel & 0x1ff;
// 7442 9: speaker out (optional?)
- m_speaker->level_w(sel >> 9 & 1);
+ m_dac->write(BIT(sel, 9));
// 74259 Q4-Q7,Q2,Q1: digit/led select (active low)
UINT8 led_sel = ~BITSWAP8(m_led_select,0,3,1,2,7,6,5,4) & 0x3f;
@@ -1020,7 +1019,7 @@ static ADDRESS_MAP_START( chesster_map, AS_PROGRAM, 8, fidel6502_state )
AM_RANGE(0x0000, 0x1fff) AM_RAM
AM_RANGE(0x2000, 0x2007) AM_MIRROR(0x1ff8) AM_READWRITE(chesster_input_r, chesster_control_w)
AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank1")
- AM_RANGE(0x6000, 0x6000) AM_MIRROR(0x1fff) AM_DEVWRITE("dac", dac_device, write_signed8)
+ AM_RANGE(0x6000, 0x6000) AM_MIRROR(0x1fff) AM_DEVWRITE("dac8", dac_byte_interface, write)
AM_RANGE(0x8000, 0xffff) AM_ROM
ADDRESS_MAP_END
@@ -1466,9 +1465,10 @@ static MACHINE_CONFIG_START( rsc, fidel6502_state )
MCFG_DEFAULT_LAYOUT(layout_fidel_rsc_v2)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT)
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( csc, fidel6502_state )
@@ -1497,13 +1497,14 @@ static MACHINE_CONFIG_START( csc, fidel6502_state )
MCFG_DEFAULT_LAYOUT(layout_fidel_csc)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_SOUND_ADD("speech", S14001A, 25000) // R/C circuit, around 25khz
MCFG_S14001A_EXT_READ_HANDLER(READ8(fidel6502_state, csc_speech_r))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.75)
- MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SOUND_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( su9, csc )
@@ -1533,13 +1534,14 @@ static MACHINE_CONFIG_START( eas, fidel6502_state )
MCFG_DEFAULT_LAYOUT(layout_fidel_eas)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_SOUND_ADD("speech", S14001A, 25000) // R/C circuit, around 25khz
MCFG_S14001A_EXT_READ_HANDLER(READ8(fidel6502_state, csc_speech_r))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.75)
- MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SOUND_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT)
/* cartridge */
MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "fidel_scc")
@@ -1571,9 +1573,10 @@ static MACHINE_CONFIG_START( sc9, fidel6502_state )
MCFG_DEFAULT_LAYOUT(layout_fidel_sc9)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT)
/* cartridge */
MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "fidel_scc")
@@ -1611,9 +1614,10 @@ static MACHINE_CONFIG_START( sc12, fidel6502_state )
MCFG_DEFAULT_LAYOUT(layout_fidel_sc12)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT)
/* cartridge */
MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "fidel_scc")
@@ -1635,9 +1639,10 @@ static MACHINE_CONFIG_START( fexcel, fidel6502_state )
MCFG_DEFAULT_LAYOUT(layout_fidel_ex)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( fexcelb, fexcel )
@@ -1668,7 +1673,7 @@ static MACHINE_CONFIG_DERIVED( fexcelv, fexcelb )
/* sound hardware */
MCFG_SOUND_ADD("speech", S14001A, 25000) // R/C circuit, around 25khz
MCFG_S14001A_EXT_READ_HANDLER(READ8(fidel6502_state, fexcelv_speech_r))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.75)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( fexceld, fexcelb )
@@ -1688,9 +1693,11 @@ static MACHINE_CONFIG_START( chesster, fidel6502_state )
MCFG_DEFAULT_LAYOUT(layout_fidel_chesster)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac8", DAC_8BIT_R2R, 0) // m74hc374b1.ic1 + 8l513_02.z2
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac8", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac8", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/fidel68k.cpp b/src/mame/drivers/fidel68k.cpp
index f6411ee7ea9..617cf5b57e2 100644
--- a/src/mame/drivers/fidel68k.cpp
+++ b/src/mame/drivers/fidel68k.cpp
@@ -143,10 +143,10 @@ B0000x-xxxxxx: see V7, -800000
******************************************************************************/
#include "emu.h"
+#include "includes/fidelz80.h"
#include "cpu/m68000/m68000.h"
#include "machine/nvram.h"
-
-#include "includes/fidelz80.h"
+#include "sound/volt_reg.h"
// internal artwork
#include "fidel_eag_68k.lh" // clickable
@@ -224,7 +224,7 @@ WRITE8_MEMBER(fidel68k_state::eag_mux_w)
// 74145 0-8: input mux, digit/led select
// 74145 9: speaker out
UINT16 sel = 1 << (data & 0xf);
- m_speaker->level_w(sel >> 9 & 1);
+ m_dac->write(BIT(sel, 9));
m_inp_mux = sel & 0x1ff;
eag_prepare_display();
}
@@ -415,9 +415,10 @@ static MACHINE_CONFIG_START( eag, fidel68k_state )
MCFG_DEFAULT_LAYOUT(layout_fidel_eag_68k)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT)
/* cartridge */
MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "fidel_scc")
diff --git a/src/mame/drivers/fidelz80.cpp b/src/mame/drivers/fidelz80.cpp
index 8da6e77c0a0..6b8782c0c02 100644
--- a/src/mame/drivers/fidelz80.cpp
+++ b/src/mame/drivers/fidelz80.cpp
@@ -490,14 +490,14 @@ expect that the software reads these once on startup only.
******************************************************************************/
#include "emu.h"
+#include "includes/fidelz80.h"
#include "cpu/z80/z80.h"
#include "cpu/mcs48/mcs48.h"
#include "machine/i8255.h"
#include "machine/i8243.h"
#include "machine/z80pio.h"
#include "sound/beep.h"
-
-#include "includes/fidelz80.h"
+#include "sound/volt_reg.h"
// internal artwork
#include "fidel_cc.lh" // clickable
@@ -881,7 +881,7 @@ WRITE8_MEMBER(fidelz80_state::bcc_control_w)
// a0-a2,d7: digit segment data via NE591, Q7 is speaker out
UINT8 mask = 1 << (offset & 7);
m_7seg_data = (m_7seg_data & ~mask) | ((data & 0x80) ? mask : 0);
- m_speaker->level_w(m_7seg_data >> 7 & 1);
+ m_dac->write(BIT(m_7seg_data, 7));
// d0-d3: led select, input mux
// d4,d5: check,lose leds(direct)
@@ -1456,9 +1456,10 @@ static MACHINE_CONFIG_START( bcc, fidelz80_state )
MCFG_DEFAULT_LAYOUT(layout_fidel_bcc)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT)
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( cc10, fidelz80_state )
@@ -1479,9 +1480,9 @@ static MACHINE_CONFIG_START( cc10, fidelz80_state )
MCFG_DEFAULT_LAYOUT(layout_fidel_cc)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_SOUND_ADD("beeper", BEEP, 1360) // approximation, from 556 timer ic
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
MCFG_TIMER_DRIVER_ADD("beeper_off", fidelz80_state, beeper_off_callback)
MACHINE_CONFIG_END
@@ -1505,10 +1506,10 @@ static MACHINE_CONFIG_START( vcc, fidelz80_state )
MCFG_MACHINE_START_OVERRIDE(fidelz80_state,vcc)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_SOUND_ADD("speech", S14001A, 25000) // R/C circuit, around 25khz
MCFG_S14001A_EXT_READ_HANDLER(READ8(fidelz80_state, vcc_speech_r))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.75)
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( vsc, fidelz80_state )
@@ -1533,10 +1534,10 @@ static MACHINE_CONFIG_START( vsc, fidelz80_state )
MCFG_DEFAULT_LAYOUT(layout_fidel_vsc)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_SOUND_ADD("speech", S14001A, 25000) // R/C circuit, around 25khz
MCFG_S14001A_EXT_READ_HANDLER(READ8(fidelz80_state, vcc_speech_r))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.75)
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( vbrc, fidelz80_state )
@@ -1556,10 +1557,10 @@ static MACHINE_CONFIG_START( vbrc, fidelz80_state )
MCFG_DEFAULT_LAYOUT(layout_fidel_vbrc)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_SOUND_ADD("speech", S14001A, 25000) // R/C circuit, around 25khz
MCFG_S14001A_BSY_HANDLER(INPUTLINE("maincpu", Z80_INPUT_LINE_WAIT))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.75)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/finalizr.cpp b/src/mame/drivers/finalizr.cpp
index 79c0cfbb869..6fc8a45d826 100644
--- a/src/mame/drivers/finalizr.cpp
+++ b/src/mame/drivers/finalizr.cpp
@@ -13,15 +13,16 @@
***************************************************************************/
#include "emu.h"
-#include "machine/konami1.h"
+#include "includes/finalizr.h"
+#include "includes/konamipt.h"
#include "cpu/m6809/m6809.h"
#include "cpu/mcs48/mcs48.h"
#include "machine/gen_latch.h"
+#include "machine/konami1.h"
#include "machine/watchdog.h"
-#include "sound/sn76496.h"
#include "sound/dac.h"
-#include "includes/konamipt.h"
-#include "includes/finalizr.h"
+#include "sound/sn76496.h"
+#include "sound/volt_reg.h"
TIMER_DEVICE_CALLBACK_MEMBER(finalizr_state::finalizr_scanline)
@@ -133,7 +134,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( sound_io_map, AS_IO, 8, finalizr_state )
AM_RANGE(0x00, 0xff) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
- AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_DEVWRITE("dac", dac_device, write_unsigned8)
+ AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_WRITE(i8039_irqen_w)
AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_WRITE(i8039_T0_w)
AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_READ(i8039_T1_r)
@@ -287,15 +288,16 @@ static MACHINE_CONFIG_START( finalizr, finalizr_state )
MCFG_PALETTE_INIT_OWNER(finalizr_state, finalizr)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("snsnd", SN76489A, XTAL_18_432MHz/12)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.75)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.65)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.325) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/flstory.cpp b/src/mame/drivers/flstory.cpp
index 1afa2a7ac5e..2d1ade9af49 100644
--- a/src/mame/drivers/flstory.cpp
+++ b/src/mame/drivers/flstory.cpp
@@ -12,11 +12,12 @@
***************************************************************************/
#include "emu.h"
+#include "includes/flstory.h"
#include "cpu/z80/z80.h"
#include "cpu/m6805/m6805.h"
#include "sound/ay8910.h"
#include "sound/dac.h"
-#include "includes/flstory.h"
+#include "sound/volt_reg.h"
READ8_MEMBER(flstory_state::from_snd_r)
{
@@ -436,7 +437,7 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, flstory_state )
AM_RANGE(0xd800, 0xd800) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_WRITE(to_main_w)
AM_RANGE(0xda00, 0xda00) AM_READNOP AM_WRITE(nmi_enable_w) /* unknown read*/
AM_RANGE(0xdc00, 0xdc00) AM_WRITE(nmi_disable_w)
- AM_RANGE(0xde00, 0xde00) AM_READNOP AM_DEVWRITE("dac", dac_device, write_unsigned8) /* signed 8-bit DAC & unknown read */
+ AM_RANGE(0xde00, 0xde00) AM_READNOP AM_DEVWRITE("dac", dac_byte_interface, write) /* signed 8-bit DAC & unknown read */
AM_RANGE(0xe000, 0xefff) AM_ROM /* space for diagnostics ROM */
ADDRESS_MAP_END
@@ -1076,31 +1077,32 @@ static MACHINE_CONFIG_START( flstory, flstory_state )
MCFG_VIDEO_START_OVERRIDE(flstory_state,flstory)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("aysnd", AY8910, XTAL_8MHz/4) /* verified on pcb */
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(flstory_state, sound_control_2_w))
MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(flstory_state, sound_control_3_w))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.1)
MCFG_SOUND_ADD("msm", MSM5232, XTAL_8MHz/4) /* verified on pcb */
MCFG_MSM5232_SET_CAPACITORS(1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6) /* 1.0 uF capacitors (verified on real PCB) */
- MCFG_SOUND_ROUTE(0, "mono", 1.0) // pin 28 2'-1
- MCFG_SOUND_ROUTE(1, "mono", 1.0) // pin 29 4'-1
- MCFG_SOUND_ROUTE(2, "mono", 1.0) // pin 30 8'-1
- MCFG_SOUND_ROUTE(3, "mono", 1.0) // pin 31 16'-1
- MCFG_SOUND_ROUTE(4, "mono", 1.0) // pin 36 2'-2
- MCFG_SOUND_ROUTE(5, "mono", 1.0) // pin 35 4'-2
- MCFG_SOUND_ROUTE(6, "mono", 1.0) // pin 34 8'-2
- MCFG_SOUND_ROUTE(7, "mono", 1.0) // pin 33 16'-2
+ MCFG_SOUND_ROUTE(0, "speaker", 1.0) // pin 28 2'-1
+ MCFG_SOUND_ROUTE(1, "speaker", 1.0) // pin 29 4'-1
+ MCFG_SOUND_ROUTE(2, "speaker", 1.0) // pin 30 8'-1
+ MCFG_SOUND_ROUTE(3, "speaker", 1.0) // pin 31 16'-1
+ MCFG_SOUND_ROUTE(4, "speaker", 1.0) // pin 36 2'-2
+ MCFG_SOUND_ROUTE(5, "speaker", 1.0) // pin 35 4'-2
+ MCFG_SOUND_ROUTE(6, "speaker", 1.0) // pin 34 8'-2
+ MCFG_SOUND_ROUTE(7, "speaker", 1.0) // pin 33 16'-2
// pin 1 SOLO 8' not mapped
// pin 2 SOLO 16' not mapped
// pin 22 Noise Output not mapped
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.1) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( onna34ro, flstory_state )
@@ -1138,31 +1140,32 @@ static MACHINE_CONFIG_START( onna34ro, flstory_state )
MCFG_VIDEO_START_OVERRIDE(flstory_state,flstory)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("aysnd", AY8910, 8000000/4)
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(flstory_state, sound_control_2_w))
MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(flstory_state, sound_control_3_w))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.1)
MCFG_SOUND_ADD("msm", MSM5232, 8000000/4)
MCFG_MSM5232_SET_CAPACITORS(1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6) /* 1.0 uF capacitors (verified on real PCB) */
- MCFG_SOUND_ROUTE(0, "mono", 1.0) // pin 28 2'-1
- MCFG_SOUND_ROUTE(1, "mono", 1.0) // pin 29 4'-1
- MCFG_SOUND_ROUTE(2, "mono", 1.0) // pin 30 8'-1
- MCFG_SOUND_ROUTE(3, "mono", 1.0) // pin 31 16'-1
- MCFG_SOUND_ROUTE(4, "mono", 1.0) // pin 36 2'-2
- MCFG_SOUND_ROUTE(5, "mono", 1.0) // pin 35 4'-2
- MCFG_SOUND_ROUTE(6, "mono", 1.0) // pin 34 8'-2
- MCFG_SOUND_ROUTE(7, "mono", 1.0) // pin 33 16'-2
+ MCFG_SOUND_ROUTE(0, "speaker", 1.0) // pin 28 2'-1
+ MCFG_SOUND_ROUTE(1, "speaker", 1.0) // pin 29 4'-1
+ MCFG_SOUND_ROUTE(2, "speaker", 1.0) // pin 30 8'-1
+ MCFG_SOUND_ROUTE(3, "speaker", 1.0) // pin 31 16'-1
+ MCFG_SOUND_ROUTE(4, "speaker", 1.0) // pin 36 2'-2
+ MCFG_SOUND_ROUTE(5, "speaker", 1.0) // pin 35 4'-2
+ MCFG_SOUND_ROUTE(6, "speaker", 1.0) // pin 34 8'-2
+ MCFG_SOUND_ROUTE(7, "speaker", 1.0) // pin 33 16'-2
// pin 1 SOLO 8' not mapped
// pin 2 SOLO 16' not mapped
// pin 22 Noise Output not mapped
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.1) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( victnine, flstory_state )
@@ -1200,31 +1203,32 @@ static MACHINE_CONFIG_START( victnine, flstory_state )
MCFG_VIDEO_START_OVERRIDE(flstory_state,victnine)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("aysnd", AY8910, 8000000/4)
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(flstory_state, sound_control_2_w))
MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(flstory_state, sound_control_3_w))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
MCFG_SOUND_ADD("msm", MSM5232, 8000000/4)
MCFG_MSM5232_SET_CAPACITORS(1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6) /* 1.0 uF capacitors (verified on real PCB) */
- MCFG_SOUND_ROUTE(0, "mono", 1.0) // pin 28 2'-1
- MCFG_SOUND_ROUTE(1, "mono", 1.0) // pin 29 4'-1
- MCFG_SOUND_ROUTE(2, "mono", 1.0) // pin 30 8'-1
- MCFG_SOUND_ROUTE(3, "mono", 1.0) // pin 31 16'-1
- MCFG_SOUND_ROUTE(4, "mono", 1.0) // pin 36 2'-2
- MCFG_SOUND_ROUTE(5, "mono", 1.0) // pin 35 4'-2
- MCFG_SOUND_ROUTE(6, "mono", 1.0) // pin 34 8'-2
- MCFG_SOUND_ROUTE(7, "mono", 1.0) // pin 33 16'-2
+ MCFG_SOUND_ROUTE(0, "speaker", 1.0) // pin 28 2'-1
+ MCFG_SOUND_ROUTE(1, "speaker", 1.0) // pin 29 4'-1
+ MCFG_SOUND_ROUTE(2, "speaker", 1.0) // pin 30 8'-1
+ MCFG_SOUND_ROUTE(3, "speaker", 1.0) // pin 31 16'-1
+ MCFG_SOUND_ROUTE(4, "speaker", 1.0) // pin 36 2'-2
+ MCFG_SOUND_ROUTE(5, "speaker", 1.0) // pin 35 4'-2
+ MCFG_SOUND_ROUTE(6, "speaker", 1.0) // pin 34 8'-2
+ MCFG_SOUND_ROUTE(7, "speaker", 1.0) // pin 33 16'-2
// pin 1 SOLO 8' not mapped
// pin 2 SOLO 16' not mapped
// pin 22 Noise Output not mapped
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.1) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
MACHINE_RESET_MEMBER(flstory_state,rumba)
@@ -1268,31 +1272,32 @@ static MACHINE_CONFIG_START( rumba, flstory_state )
MCFG_VIDEO_START_OVERRIDE(flstory_state,rumba)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("aysnd", AY8910, XTAL_8MHz/4) /* verified on pcb */
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(flstory_state, sound_control_2_w))
MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(flstory_state, sound_control_3_w))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
MCFG_SOUND_ADD("msm", MSM5232, XTAL_8MHz/4) /* verified on pcb */
MCFG_MSM5232_SET_CAPACITORS(1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6) /* 1.0 uF capacitors (verified on real PCB) */
- MCFG_SOUND_ROUTE(0, "mono", 1.0) // pin 28 2'-1
- MCFG_SOUND_ROUTE(1, "mono", 1.0) // pin 29 4'-1
- MCFG_SOUND_ROUTE(2, "mono", 1.0) // pin 30 8'-1
- MCFG_SOUND_ROUTE(3, "mono", 1.0) // pin 31 16'-1
- MCFG_SOUND_ROUTE(4, "mono", 1.0) // pin 36 2'-2
- MCFG_SOUND_ROUTE(5, "mono", 1.0) // pin 35 4'-2
- MCFG_SOUND_ROUTE(6, "mono", 1.0) // pin 34 8'-2
- MCFG_SOUND_ROUTE(7, "mono", 1.0) // pin 33 16'-2
+ MCFG_SOUND_ROUTE(0, "speaker", 1.0) // pin 28 2'-1
+ MCFG_SOUND_ROUTE(1, "speaker", 1.0) // pin 29 4'-1
+ MCFG_SOUND_ROUTE(2, "speaker", 1.0) // pin 30 8'-1
+ MCFG_SOUND_ROUTE(3, "speaker", 1.0) // pin 31 16'-1
+ MCFG_SOUND_ROUTE(4, "speaker", 1.0) // pin 36 2'-2
+ MCFG_SOUND_ROUTE(5, "speaker", 1.0) // pin 35 4'-2
+ MCFG_SOUND_ROUTE(6, "speaker", 1.0) // pin 34 8'-2
+ MCFG_SOUND_ROUTE(7, "speaker", 1.0) // pin 33 16'-2
// pin 1 SOLO 8' not mapped
// pin 2 SOLO 16' not mapped
// pin 22 Noise Output not mapped
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.1) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
/***************************************************************************
diff --git a/src/mame/drivers/fruitpc.cpp b/src/mame/drivers/fruitpc.cpp
index b0a1c415ca7..f5c5ad4cd3a 100644
--- a/src/mame/drivers/fruitpc.cpp
+++ b/src/mame/drivers/fruitpc.cpp
@@ -19,7 +19,6 @@
#include "machine/pckeybrd.h"
#include "machine/idectrl.h"
#include "video/pc_vga.h"
-#include "sound/dac.h"
#include "machine/pcshare.h"
#include "bus/isa/isa.h"
#include "bus/isa/sblaster.h"
diff --git a/src/mame/drivers/galaxian.cpp b/src/mame/drivers/galaxian.cpp
index 494e7eaa2d7..955b76e9db5 100644
--- a/src/mame/drivers/galaxian.cpp
+++ b/src/mame/drivers/galaxian.cpp
@@ -655,14 +655,15 @@ TODO:
***************************************************************************/
#include "emu.h"
-#include "cpu/z80/z80.h"
+#include "includes/galaxian.h"
+#include "audio/cclimber.h"
+#include "audio/galaxian.h"
#include "cpu/s2650/s2650.h"
+#include "cpu/z80/z80.h"
#include "machine/watchdog.h"
-#include "sound/sn76496.h"
#include "sound/discrete.h"
-#include "audio/cclimber.h"
-#include "audio/galaxian.h"
-#include "includes/galaxian.h"
+#include "sound/sn76496.h"
+#include "sound/volt_reg.h"
#define KONAMI_SOUND_CLOCK 14318000
@@ -971,7 +972,7 @@ WRITE8_MEMBER(galaxian_state::sfx_sample_io_w)
{
/* the decoding here is very simplistic, and you can address both simultaneously */
if (offset & 0x04) m_ppi8255_2->write(space, offset & 3, data);
- if (offset & 0x10) m_dac->write_signed8(data);
+ if (offset & 0x10) m_dac->write(data);
}
@@ -1347,7 +1348,7 @@ WRITE8_MEMBER(galaxian_state::kingball_sound2_w)
WRITE8_MEMBER(galaxian_state::kingball_dac_w)
{
- m_dac->write_unsigned8(data ^ 0xff);
+ m_dac->write(data >> 4);
}
@@ -5532,7 +5533,7 @@ static MACHINE_CONFIG_START( galaxian_base, galaxian_state )
MCFG_TIMER_DRIVER_ADD_PERIODIC("stars", galaxian_state, galaxian_stars_blink_timer, PERIOD_OF_555_ASTABLE(100000, 10000, 0.00001))
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MACHINE_CONFIG_END
@@ -5574,7 +5575,7 @@ static MACHINE_CONFIG_FRAGMENT( konami_sound_1x_ay8910 )
MCFG_SOUND_ADD("konami", DISCRETE, 0)
MCFG_DISCRETE_INTF(konami_sound)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.75)
MACHINE_CONFIG_END
@@ -5606,7 +5607,7 @@ static MACHINE_CONFIG_FRAGMENT( konami_sound_2x_ay8910 )
MCFG_SOUND_ADD("konami", DISCRETE, 0)
MCFG_DISCRETE_INTF(konami_sound)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
MACHINE_CONFIG_END
@@ -5659,7 +5660,7 @@ static MACHINE_CONFIG_DERIVED( zigzag, galaxian_base )
/* sound hardware */
MCFG_SOUND_ADD("8910.0", AY8910, GALAXIAN_PIXEL_CLOCK/3/2) /* matches PCB video - unconfirmed */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
MACHINE_CONFIG_END
@@ -5696,10 +5697,10 @@ static MACHINE_CONFIG_DERIVED( fantastc, galaxian_base )
/* sound hardware */
MCFG_SOUND_ADD("8910.0", AY8910, GALAXIAN_PIXEL_CLOCK/3/2) // 3.072MHz
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
MCFG_SOUND_ADD("8910.1", AY8910, GALAXIAN_PIXEL_CLOCK/3/2) // 3.072MHz
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
MACHINE_CONFIG_END
@@ -5726,10 +5727,10 @@ static MACHINE_CONFIG_DERIVED( timefgtr, galaxian_base )
/* sound hardware */
MCFG_SOUND_ADD("8910.0", AY8910, GALAXIAN_PIXEL_CLOCK/3/2) // 3.072MHz
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
MCFG_SOUND_ADD("8910.1", AY8910, GALAXIAN_PIXEL_CLOCK/3/2) // 3.072MHz
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
MACHINE_CONFIG_END
@@ -5743,7 +5744,7 @@ static MACHINE_CONFIG_DERIVED( jumpbug, galaxian_base )
/* sound hardware */
MCFG_SOUND_ADD("8910.0", AY8910, GALAXIAN_PIXEL_CLOCK/3/2/2) /* matches PCB video - unconfirmed */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
MACHINE_CONFIG_END
@@ -5759,7 +5760,7 @@ static MACHINE_CONFIG_DERIVED( checkman, mooncrst )
/* sound hardware */
MCFG_SOUND_ADD("8910.0", AY8910, 1789750)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
MACHINE_CONFIG_END
@@ -5780,7 +5781,7 @@ static MACHINE_CONFIG_DERIVED( checkmaj, galaxian_base )
/* sound hardware */
MCFG_SOUND_ADD("8910.0", AY8910, 1620000)
MCFG_AY8910_PORT_A_READ_CB(DEVREAD8("soundlatch", generic_latch_8_device, read))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 2)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 2)
MACHINE_CONFIG_END
@@ -5807,8 +5808,9 @@ static MACHINE_CONFIG_DERIVED( kingball, mooncrst )
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
/* sound hardware */
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ADD("dac", DAC_4BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.53) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
@@ -5930,11 +5932,11 @@ static MACHINE_CONFIG_DERIVED( explorer, galaxian_base )
/* sound hardware */
MCFG_SOUND_ADD("8910.0", AY8910, KONAMI_SOUND_CLOCK/8)
MCFG_AY8910_PORT_A_READ_CB(READ8(galaxian_state, explorer_sound_latch_r))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
MCFG_SOUND_ADD("8910.1", AY8910, KONAMI_SOUND_CLOCK/8)
MCFG_AY8910_PORT_A_READ_CB(READ8(galaxian_state, konami_sound_timer_r))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( takeoff, explorer ) // takeoff shares the same main map as explorer, but uses only an AY8912 for sound.
@@ -5954,7 +5956,7 @@ static MACHINE_CONFIG_DERIVED( takeoff, explorer ) // takeoff shares the same ma
MCFG_SOUND_ADD("8912", AY8912, XTAL_12MHz / 8)
MCFG_AY8910_PORT_A_READ_CB(READ8(galaxian_state, explorer_sound_latch_r))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( scorpion, theend )
@@ -5978,10 +5980,10 @@ static MACHINE_CONFIG_DERIVED( scorpion, theend )
MCFG_SOUND_ADD("8910.2", AY8910, KONAMI_SOUND_CLOCK/8)
MCFG_AY8910_PORT_A_WRITE_CB(DEVWRITE8("digitalker", digitalker_device, digitalker_data_w))
MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(galaxian_state, scorpion_digitalker_control_w))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
MCFG_DIGITALKER_ADD("digitalker", 4000000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.16)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.16)
MACHINE_CONFIG_END
@@ -6022,8 +6024,9 @@ static MACHINE_CONFIG_DERIVED( sfx, galaxian_base )
MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(galaxian_state, sfx_sample_control_w))
/* DAC for the sample player */
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
@@ -6136,7 +6139,7 @@ static MACHINE_CONFIG_DERIVED( anteater, scobra )
/* quiet down the sounds */
MCFG_SOUND_MODIFY("konami")
MCFG_SOUND_ROUTES_RESET()
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/galaxold.cpp b/src/mame/drivers/galaxold.cpp
index e33e6f55b15..0617a794f28 100644
--- a/src/mame/drivers/galaxold.cpp
+++ b/src/mame/drivers/galaxold.cpp
@@ -105,7 +105,6 @@ Stephh's notes (based on the games Z80 code and some tests) for other games :
#include "machine/watchdog.h"
#include "sound/ay8910.h"
#include "sound/sn76496.h"
-#include "sound/dac.h"
#include "audio/galaxian.h"
#include "includes/galaxold.h"
@@ -2239,7 +2238,7 @@ static MACHINE_CONFIG_START( galaxold_base, galaxold_state )
MCFG_VIDEO_START_OVERRIDE(galaxold_state,galaxold)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MACHINE_CONFIG_END
@@ -2428,7 +2427,7 @@ static MACHINE_CONFIG_DERIVED( ozon1, galaxold_base )
MCFG_VIDEO_START_OVERRIDE(galaxold_state,ozon1)
MCFG_SOUND_ADD("aysnd", AY8910, PIXEL_CLOCK/4)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
MACHINE_CONFIG_END
@@ -2457,7 +2456,7 @@ static MACHINE_CONFIG_START( drivfrcg, galaxold_state )
MCFG_VIDEO_START_OVERRIDE(galaxold_state,drivfrcg)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_FRAGMENT_ADD(galaxian_audio)
MACHINE_CONFIG_END
@@ -2478,7 +2477,7 @@ static MACHINE_CONFIG_DERIVED( bongo, galaxold_base )
/* sound hardware */
MCFG_SOUND_ADD("aysnd", AY8910, PIXEL_CLOCK/4)
MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW1"))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
MACHINE_CONFIG_END
@@ -2538,9 +2537,9 @@ static MACHINE_CONFIG_START( racknrol, galaxold_state )
MCFG_VIDEO_START_OVERRIDE(galaxold_state,racknrol)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_SOUND_ADD("snsnd", SN76489A, PIXEL_CLOCK/2) // SN76489AN
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
@@ -2564,9 +2563,9 @@ static MACHINE_CONFIG_START( hexpoola, galaxold_state )
MCFG_VIDEO_START_OVERRIDE(galaxold_state,racknrol)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_SOUND_ADD("snsnd", SN76496, PIXEL_CLOCK/2)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/galeb.cpp b/src/mame/drivers/galeb.cpp
index d595a603966..9faf0b73a54 100644
--- a/src/mame/drivers/galeb.cpp
+++ b/src/mame/drivers/galeb.cpp
@@ -14,26 +14,58 @@
#include "emu.h"
-#include "cpu/m6502/m6502.h"
-#include "sound/dac.h"
#include "includes/galeb.h"
+#include "cpu/m6502/m6502.h"
+#include "sound/volt_reg.h"
static GFXDECODE_START( galeb )
GFXDECODE_ENTRY( "gfx1", 0x0000, galeb_charlayout, 0, 1 )
GFXDECODE_END
-READ8_MEMBER(galeb_state::galeb_keyboard_r)
+void galeb_state::machine_start()
{
- static const char *const keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7" };
+ save_item(NAME(m_dac_state));
- return ioport(keynames[offset])->read();
+ m_dac->write(m_dac_state);
+}
+
+WRITE8_MEMBER(galeb_state::dac_w)
+{
+ m_dac_state = !m_dac_state;
+ m_dac->write(m_dac_state);
+}
+
+READ8_MEMBER(galeb_state::keyboard_r)
+{
+ return m_keyboard[offset]->read();
+}
+
+READ8_MEMBER(galeb_state::tape_status_r)
+{
+ int status = 0;
+ status |= 2; /// send ready
+ status |= 1; /// receive ready
+ return status;
+}
+
+WRITE8_MEMBER(galeb_state::tape_data_w)
+{
+ logerror("tape_data_w %02x\n", data);
+}
+
+READ8_MEMBER(galeb_state::tape_data_r)
+{
+ logerror("tape_data_r (press escape to cancel load)\n");
+ return 0x00;
}
/* Address maps */
static ADDRESS_MAP_START(galeb_mem, AS_PROGRAM, 8, galeb_state )
AM_RANGE( 0x0000, 0x1fff ) AM_RAM // RAM
- AM_RANGE( 0xbfe0, 0xbfe7 ) AM_READ(galeb_keyboard_r )
- AM_RANGE( 0xbfe0, 0xbfe0 ) AM_DEVWRITE("dac", dac_device, write_unsigned8)
+ AM_RANGE( 0xbfe0, 0xbfe7 ) AM_READ(keyboard_r )
+ AM_RANGE( 0xbfe0, 0xbfe0 ) AM_WRITE(dac_w)
+ AM_RANGE( 0xbffe, 0xbffe ) AM_READ(tape_status_r)
+ AM_RANGE( 0xbfff, 0xbfff ) AM_READWRITE(tape_data_r, tape_data_w)
AM_RANGE( 0xb000, 0xb3ff ) AM_RAM AM_SHARE("video_ram") // video ram
AM_RANGE( 0xc000, 0xc7ff ) AM_ROM // BASIC 01 ROM
AM_RANGE( 0xc800, 0xcfff ) AM_ROM // BASIC 02 ROM
@@ -147,9 +179,10 @@ static MACHINE_CONFIG_START( galeb, galeb_state )
/* audio hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("dac", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 8.00)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.0625) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT)
MACHINE_CONFIG_END
/* ROM definition */
diff --git a/src/mame/drivers/galivan.cpp b/src/mame/drivers/galivan.cpp
index 4b5e8b109b3..67230e355df 100644
--- a/src/mame/drivers/galivan.cpp
+++ b/src/mame/drivers/galivan.cpp
@@ -34,10 +34,11 @@ TODO
***************************************************************************/
#include "emu.h"
+#include "includes/galivan.h"
#include "cpu/z80/z80.h"
-#include "sound/dac.h"
#include "sound/3526intf.h"
-#include "includes/galivan.h"
+#include "sound/dac.h"
+#include "sound/volt_reg.h"
WRITE8_MEMBER(galivan_state::galivan_sound_command_w)
@@ -119,8 +120,8 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( sound_io_map, AS_IO, 8, galivan_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x01) AM_DEVWRITE("ymsnd", ym3526_device, write)
- AM_RANGE(0x02, 0x02) AM_DEVWRITE("dac1", dac_device, write_unsigned8)
- AM_RANGE(0x03, 0x03) AM_DEVWRITE("dac2", dac_device, write_unsigned8)
+ AM_RANGE(0x02, 0x02) AM_DEVWRITE("dac1", dac_byte_interface, write)
+ AM_RANGE(0x03, 0x03) AM_DEVWRITE("dac2", dac_byte_interface, write)
AM_RANGE(0x04, 0x04) AM_READ(soundlatch_clear_r)
AM_RANGE(0x06, 0x06) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
ADDRESS_MAP_END
@@ -450,18 +451,18 @@ static MACHINE_CONFIG_START( galivan, galivan_state )
MCFG_VIDEO_START_OVERRIDE(galivan_state,galivan)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("ymsnd", YM3526, XTAL_8MHz/2)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
-
- MCFG_DAC_ADD("dac1")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
- MCFG_DAC_ADD("dac2")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ADD("dac1", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) // unknown DAC
+ MCFG_SOUND_ADD("dac2", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac1", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac1", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac2", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac2", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( ninjemak, galivan_state )
@@ -502,18 +503,18 @@ static MACHINE_CONFIG_START( ninjemak, galivan_state )
MCFG_VIDEO_START_OVERRIDE(galivan_state,ninjemak)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("ymsnd", YM3526, XTAL_8MHz/2)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
-
- MCFG_DAC_ADD("dac1")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
- MCFG_DAC_ADD("dac2")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ADD("dac1", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) // unknown DAC
+ MCFG_SOUND_ADD("dac2", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac1", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac1", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac2", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac2", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/gamecom.cpp b/src/mame/drivers/gamecom.cpp
index 3e0a9d046c7..1ece0f8cd2f 100644
--- a/src/mame/drivers/gamecom.cpp
+++ b/src/mame/drivers/gamecom.cpp
@@ -24,6 +24,7 @@ Game Status:
***************************************************************************/
#include "includes/gamecom.h"
+#include "sound/volt_reg.h"
#include "softlist.h"
#include "gamecom.lh"
@@ -266,17 +267,15 @@ static MACHINE_CONFIG_START( gamecom, gamecom_state )
MCFG_PALETTE_INIT_OWNER(gamecom_state, gamecom)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_STEREO( "lspeaker", "rspeaker" )
+ MCFG_SPEAKER_STANDARD_MONO( "speaker" )
/* TODO: much more complex than this */
- MCFG_SOUND_ADD("dac", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.00)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.00)
- MCFG_SOUND_ADD("dac0", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.10)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.10)
- MCFG_SOUND_ADD("dac1", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.10)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.10)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) // unknown DAC (Digital audio)
+ MCFG_SOUND_ADD("dac0", DAC_4BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.05) // unknown DAC (Frequency modulation)
+ MCFG_SOUND_ADD("dac1", DAC_4BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.05) // unknown DAC (Frequency modulation)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac0", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac0", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac1", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac1", -1.0, DAC_VREF_NEG_INPUT)
/* cartridge */
MCFG_GENERIC_CARTSLOT_ADD("cartslot1", generic_linear_slot, "gamecom_cart")
diff --git a/src/mame/drivers/gba.cpp b/src/mame/drivers/gba.cpp
index aa6ac9fa745..607fee7e7c2 100644
--- a/src/mame/drivers/gba.cpp
+++ b/src/mame/drivers/gba.cpp
@@ -11,12 +11,12 @@
***************************************************************************/
#include "emu.h"
+#include "includes/gba.h"
+#include "bus/gba/rom.h"
#include "cpu/arm7/arm7.h"
#include "cpu/arm7/arm7core.h"
-#include "sound/dac.h"
#include "sound/gb.h"
-#include "includes/gba.h"
-#include "bus/gba/rom.h"
+#include "sound/volt_reg.h"
#include "softlist.h"
/* Sound Registers */
@@ -329,11 +329,11 @@ void gba_state::audio_tick(int ref)
if (SOUNDCNT_H & 0x200)
{
- m_ladac->write_signed8(m_fifo_a[m_fifo_a_ptr]^0x80);
+ m_ldaca->write(m_fifo_a[m_fifo_a_ptr]);
}
if (SOUNDCNT_H & 0x100)
{
- m_radac->write_signed8(m_fifo_a[m_fifo_a_ptr]^0x80);
+ m_rdaca->write(m_fifo_a[m_fifo_a_ptr]);
}
m_fifo_a_ptr++;
}
@@ -365,11 +365,11 @@ void gba_state::audio_tick(int ref)
if (SOUNDCNT_H & 0x2000)
{
- m_lbdac->write_signed8(m_fifo_b[m_fifo_b_ptr]^0x80);
+ m_ldacb->write(m_fifo_b[m_fifo_b_ptr]);
}
if (SOUNDCNT_H & 0x1000)
{
- m_rbdac->write_signed8(m_fifo_b[m_fifo_b_ptr]^0x80);
+ m_rdacb->write(m_fifo_b[m_fifo_b_ptr]);
}
m_fifo_b_ptr++;
}
@@ -865,8 +865,8 @@ WRITE32_MEMBER(gba_state::gba_io_w)
{
m_fifo_a_ptr = 17;
m_fifo_a_in = 17;
- m_ladac->write_signed8(0x80);
- m_radac->write_signed8(0x80);
+ m_ldaca->write(0);
+ m_rdaca->write(0);
}
// DAC B reset?
@@ -874,8 +874,8 @@ WRITE32_MEMBER(gba_state::gba_io_w)
{
m_fifo_b_ptr = 17;
m_fifo_b_in = 17;
- m_lbdac->write_signed8(0x80);
- m_rbdac->write_signed8(0x80);
+ m_ldacb->write(0);
+ m_rdacb->write(0);
}
}
break;
@@ -887,10 +887,10 @@ WRITE32_MEMBER(gba_state::gba_io_w)
{
m_fifo_a_ptr = m_fifo_a_in = 17;
m_fifo_b_ptr = m_fifo_b_in = 17;
- m_ladac->write_signed8(0x80);
- m_radac->write_signed8(0x80);
- m_lbdac->write_signed8(0x80);
- m_rbdac->write_signed8(0x80);
+ m_ldaca->write(0);
+ m_rdaca->write(0);
+ m_ldacb->write(0);
+ m_rdacb->write(0);
}
}
break;
@@ -1263,10 +1263,10 @@ void gba_state::machine_reset()
m_fifo_a_in = m_fifo_b_in = 17;
// and clear the DACs
- m_ladac->write_signed8(0x80);
- m_radac->write_signed8(0x80);
- m_lbdac->write_signed8(0x80);
- m_rbdac->write_signed8(0x80);
+ m_ldaca->write(0);
+ m_rdaca->write(0);
+ m_ldacb->write(0);
+ m_rdacb->write(0);
}
void gba_state::machine_start()
@@ -1407,18 +1407,20 @@ static MACHINE_CONFIG_START( gbadv, gba_state )
MCFG_GBA_LCD_DMA_HBLANK(WRITELINE(gba_state, dma_hblank_callback))
MCFG_GBA_LCD_DMA_VBLANK(WRITELINE(gba_state, dma_vblank_callback))
- MCFG_SPEAKER_STANDARD_STEREO("spkleft", "spkright")
+ MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
MCFG_SOUND_ADD("custom", CGB04_APU, XTAL_16_777216MHz/4)
- MCFG_SOUND_ROUTE(0, "spkleft", 0.50)
- MCFG_SOUND_ROUTE(1, "spkright", 0.50)
- MCFG_SOUND_ADD("direct_a_left", DAC, 0) // GBA direct sound A left
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "spkleft", 0.50)
- MCFG_SOUND_ADD("direct_a_right", DAC, 0) // GBA direct sound A right
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "spkright", 0.50)
- MCFG_SOUND_ADD("direct_b_left", DAC, 0) // GBA direct sound B left
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "spkleft", 0.50)
- MCFG_SOUND_ADD("direct_b_right", DAC, 0) // GBA direct sound B right
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "spkright", 0.50)
+ MCFG_SOUND_ROUTE(0, "lspeaker", 0.5)
+ MCFG_SOUND_ROUTE(1, "rspeaker", 0.5)
+
+ MCFG_SOUND_ADD("ldaca", DAC_8BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.5) // unknown DAC
+ MCFG_SOUND_ADD("rdaca", DAC_8BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.5) // unknown DAC
+ MCFG_SOUND_ADD("ldacb", DAC_8BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.5) // unknown DAC
+ MCFG_SOUND_ADD("rdacb", DAC_8BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.5) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "ldaca", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "ldaca", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "rdaca", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "rdaca", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "ldacb", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "ldacb", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "rdacb", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "rdacb", -1.0, DAC_VREF_NEG_INPUT)
MCFG_GBA_CARTRIDGE_ADD("cartslot", gba_cart, nullptr)
MCFG_SOFTWARE_LIST_ADD("cart_list","gba")
diff --git a/src/mame/drivers/gei.cpp b/src/mame/drivers/gei.cpp
index e9aa2de3526..1e46fe8e471 100644
--- a/src/mame/drivers/gei.cpp
+++ b/src/mame/drivers/gei.cpp
@@ -74,9 +74,10 @@ NOTE: Trivia Question rom names are the internal names used. IE: read from the f
#include "emu.h"
#include "cpu/z80/z80.h"
#include "machine/i8255.h"
-#include "machine/ticket.h"
#include "machine/nvram.h"
+#include "machine/ticket.h"
#include "sound/dac.h"
+#include "sound/volt_reg.h"
class gei_state : public driver_device
@@ -90,7 +91,7 @@ public:
m_screen(*this, "screen") { }
required_device<cpu_device> m_maincpu;
- required_device<dac_device> m_dac;
+ required_device<dac_bit_interface> m_dac;
optional_device<ticket_dispenser_device> m_ticket;
required_device<screen_device> m_screen;
@@ -216,7 +217,7 @@ WRITE8_MEMBER(gei_state::sound_w)
m_nmi_mask = data & 0x40;
/* bit 7 goes directly to the sound amplifier */
- m_dac->write_unsigned8(((data & 0x80) >> 7) * 255);
+ m_dac->write(BIT(data, 7));
}
WRITE8_MEMBER(gei_state::sound2_w)
@@ -233,7 +234,7 @@ WRITE8_MEMBER(gei_state::sound2_w)
output().set_led_value(12,data & 0x20);
/* bit 7 goes directly to the sound amplifier */
- m_dac->write(((data & 0x80) >> 7) * 255);
+ m_dac->write(BIT(data, 7));
}
WRITE8_MEMBER(gei_state::lamps2_w)
@@ -1053,10 +1054,10 @@ static MACHINE_CONFIG_START( getrivia, gei_state )
MCFG_TICKET_DISPENSER_ADD("ticket", attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
-
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.99)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( findout, getrivia )
diff --git a/src/mame/drivers/go2000.cpp b/src/mame/drivers/go2000.cpp
index a9d5e47d241..82316f301df 100644
--- a/src/mame/drivers/go2000.cpp
+++ b/src/mame/drivers/go2000.cpp
@@ -36,6 +36,7 @@ Notes:
#include "cpu/z80/z80.h"
#include "machine/gen_latch.h"
#include "sound/dac.h"
+#include "sound/volt_reg.h"
class go2000_state : public driver_device
{
@@ -104,7 +105,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( go2000_sound_io, AS_IO, 8, go2000_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x00) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
- AM_RANGE(0x00, 0x00) AM_DEVWRITE("dac1", dac_device, write_unsigned8)
+ AM_RANGE(0x00, 0x00) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(0x03, 0x03) AM_WRITE(go2000_pcm_1_bankswitch_w)
ADDRESS_MAP_END
@@ -354,13 +355,12 @@ static MACHINE_CONFIG_START( go2000, go2000_state )
MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
- MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
-
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_DAC_ADD("dac1")
- MCFG_SOUND_ROUTE(0, "lspeaker", 0.50)
- MCFG_SOUND_ROUTE(1, "rspeaker", 0.50)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(0, "speaker", 0.25) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
ROM_START( go2000 )
diff --git a/src/mame/drivers/gottlieb.cpp b/src/mame/drivers/gottlieb.cpp
index 2a335e14010..5fb828631be 100644
--- a/src/mame/drivers/gottlieb.cpp
+++ b/src/mame/drivers/gottlieb.cpp
@@ -1782,32 +1782,32 @@ static MACHINE_CONFIG_START( gottlieb_core, gottlieb_state )
MCFG_PALETTE_ADD("palette", 16)
// basic speaker configuration
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( gottlieb1, gottlieb_core )
- MCFG_GOTTLIEB_SOUND_R1_ADD("r1sound")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ADD("r1sound", GOTTLIEB_SOUND_REV1, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( gottlieb2, gottlieb_core )
- MCFG_GOTTLIEB_SOUND_R2_ADD("r2sound")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ADD("r2sound", GOTTLIEB_SOUND_REV2, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( g2laser, gottlieb_core )
- MCFG_GOTTLIEB_SOUND_R2_ADD("r2sound")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ADD("r2sound", GOTTLIEB_SOUND_REV2, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MCFG_LASERDISC_PR8210_ADD("laserdisc")
MCFG_LASERDISC_AUDIO(laserdisc_audio_delegate(FUNC(gottlieb_state::laserdisc_audio_process), (gottlieb_state*)owner))
MCFG_LASERDISC_OVERLAY_DRIVER(GOTTLIEB_VIDEO_HCOUNT, GOTTLIEB_VIDEO_VCOUNT, gottlieb_state, screen_update_gottlieb)
MCFG_LASERDISC_OVERLAY_CLIP(0, GOTTLIEB_VIDEO_HBLANK-1, 0, GOTTLIEB_VIDEO_VBLANK-8)
MCFG_LASERDISC_OVERLAY_PALETTE("palette")
- MCFG_SOUND_ROUTE(0, "mono", 1.0)
+ MCFG_SOUND_ROUTE(0, "speaker", 1.0)
/* right channel is processed as data */
MCFG_DEVICE_REMOVE("screen")
@@ -1856,8 +1856,8 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( gottlieb1_votrax, gottlieb_core )
- MCFG_GOTTLIEB_SOUND_R1_ADD_VOTRAX("r1sound")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ADD("r1sound", GOTTLIEB_SOUND_REV1_WITH_VOTRAX, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
@@ -1891,15 +1891,16 @@ static MACHINE_CONFIG_DERIVED( screwloo, gottlieb2 )
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( cobram3, gottlieb_core )
- MCFG_GOTTLIEB_SOUND_R2_ADD_COBRAM3("r2sound")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ADD("r2sound", GOTTLIEB_SOUND_REV2, 0)
+ MCFG_GOTTLIEB_ENABLE_COBRAM3_MODS()
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MCFG_LASERDISC_PR8210_ADD("laserdisc")
MCFG_LASERDISC_AUDIO(laserdisc_audio_delegate(FUNC(gottlieb_state::laserdisc_audio_process), (gottlieb_state*)owner))
MCFG_LASERDISC_OVERLAY_DRIVER(GOTTLIEB_VIDEO_HCOUNT, GOTTLIEB_VIDEO_VCOUNT, gottlieb_state, screen_update_gottlieb)
MCFG_LASERDISC_OVERLAY_CLIP(0, GOTTLIEB_VIDEO_HBLANK-1, 0, GOTTLIEB_VIDEO_VBLANK-8)
MCFG_LASERDISC_OVERLAY_PALETTE("palette")
- MCFG_SOUND_ROUTE(0, "mono", 1.0)
+ MCFG_SOUND_ROUTE(0, "speaker", 1.0)
/* right channel is processed as data */
MCFG_DEVICE_REMOVE("screen")
diff --git a/src/mame/drivers/gp32.cpp b/src/mame/drivers/gp32.cpp
index 0addf2d91c2..a72a0575f56 100644
--- a/src/mame/drivers/gp32.cpp
+++ b/src/mame/drivers/gp32.cpp
@@ -17,9 +17,10 @@
**************************************************************************/
#include "emu.h"
+#include "includes/gp32.h"
#include "cpu/arm7/arm7.h"
#include "cpu/arm7/arm7core.h"
-#include "includes/gp32.h"
+#include "sound/volt_reg.h"
#include "rendlay.h"
#include "softlist.h"
@@ -1519,8 +1520,8 @@ WRITE32_MEMBER(gp32_state::s3c240x_iis_w)
if (m_s3c240x_iis.fifo_index == 2)
{
m_s3c240x_iis.fifo_index = 0;
- m_dac1->write_signed16(m_s3c240x_iis.fifo[0] + 0x8000);
- m_dac2->write_signed16(m_s3c240x_iis.fifo[1] + 0x8000);
+ m_ldac->write(m_s3c240x_iis.fifo[0]);
+ m_rdac->write(m_s3c240x_iis.fifo[1]);
}
}
break;
@@ -1693,10 +1694,11 @@ static MACHINE_CONFIG_START( gp32, gp32_state )
MCFG_DEFAULT_LAYOUT(layout_lcd_rot)
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
- MCFG_SOUND_ADD("dac1", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_SOUND_ADD("dac2", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
+ MCFG_SOUND_ADD("ldac", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) // unknown DAC
+ MCFG_SOUND_ADD("rdac", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "ldac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "ldac", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "rdac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "rdac", -1.0, DAC_VREF_NEG_INPUT)
MCFG_NVRAM_ADD_1FILL("nvram")
diff --git a/src/mame/drivers/gts80.cpp b/src/mame/drivers/gts80.cpp
index fae401f2695..58d014d4c08 100644
--- a/src/mame/drivers/gts80.cpp
+++ b/src/mame/drivers/gts80.cpp
@@ -374,23 +374,23 @@ static MACHINE_CONFIG_START( gts80, gts80_state )
/* Sound */
MCFG_FRAGMENT_ADD( genpin_audio )
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( gts80_s, gts80 )
- MCFG_GOTTLIEB_SOUND_R0_ADD("r0sound")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ADD("r0sound", GOTTLIEB_SOUND_REV0, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( gts80_hh, gts80 )
- MCFG_GOTTLIEB_SOUND_R1_ADD("r1sound")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ADD("r1sound", GOTTLIEB_SOUND_REV1, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( gts80_ss, gts80 )
- MCFG_GOTTLIEB_SOUND_R1_ADD("r1sound")
- //MCFG_GOTTLIEB_SOUND_R1_ADD_VOTRAX("r1sound") // votrax crashes
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ADD("r1sound", GOTTLIEB_SOUND_REV1, 0)
+ //MCFG_SOUND_ADD("r1sound", GOTTLIEB_SOUND_REV1_WITH_VOTRAX, 0) // votrax crashes
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
/*-------------------------------------------------------------------
diff --git a/src/mame/drivers/gts80a.cpp b/src/mame/drivers/gts80a.cpp
index d06ee59cc01..5d883ec4dfa 100644
--- a/src/mame/drivers/gts80a.cpp
+++ b/src/mame/drivers/gts80a.cpp
@@ -363,18 +363,18 @@ static MACHINE_CONFIG_START( gts80a, gts80a_state )
/* Sound */
MCFG_FRAGMENT_ADD( genpin_audio )
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( gts80a_s, gts80a )
- MCFG_GOTTLIEB_SOUND_R0_ADD("r0sound")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ADD("r0sound", GOTTLIEB_SOUND_REV0, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( gts80a_ss, gts80a )
- MCFG_GOTTLIEB_SOUND_R1_ADD("r1sound")
- //MCFG_GOTTLIEB_SOUND_R1_ADD_VOTRAX("r1sound") // votrax crashes
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ADD("r1sound", GOTTLIEB_SOUND_REV1, 0)
+ //MCFG_SOUND_ADD("r1sound", GOTTLIEB_SOUND_REV1_WITH_VOTRAX, 0) // votrax crashes
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/gts80b.cpp b/src/mame/drivers/gts80b.cpp
index 2f38cd3b7f5..41419b762e6 100644
--- a/src/mame/drivers/gts80b.cpp
+++ b/src/mame/drivers/gts80b.cpp
@@ -401,18 +401,18 @@ static MACHINE_CONFIG_START( gts80b, gts80b_state )
/* Sound */
MCFG_FRAGMENT_ADD( genpin_audio )
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( gts80b_s, gts80b )
- MCFG_GOTTLIEB_SOUND_R0_ADD("r0sound")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ADD("r0sound", GOTTLIEB_SOUND_REV0, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
//static MACHINE_CONFIG_DERIVED( gts80b_ss, gts80b )
-// MCFG_GOTTLIEB_SOUND_R1_ADD("r1sound")
-// //MCFG_GOTTLIEB_SOUND_R1_ADD_VOTRAX("r1sound") // votrax crashes
-// MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+// MCFG_SOUND_ADD("r1sound", GOTTLIEB_SOUND_REV1, 0)
+// //MCFG_SOUND_ADD("r1sound", GOTTLIEB_SOUND_REV1_WITH_VOTRAX, 0) // votrax crashes
+// MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
//MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( gts80b_s1, gts80b )
diff --git a/src/mame/drivers/hankin.cpp b/src/mame/drivers/hankin.cpp
index c31bce41d45..8d99c6de57e 100644
--- a/src/mame/drivers/hankin.cpp
+++ b/src/mame/drivers/hankin.cpp
@@ -19,6 +19,7 @@ ToDo:
#include "cpu/m6800/m6800.h"
#include "machine/6821pia.h"
#include "sound/dac.h"
+#include "sound/volt_reg.h"
#include "hankin.lh"
class hankin_state : public genpin_class
@@ -83,7 +84,7 @@ private:
required_device<pia6821_device> m_ic10;
required_device<pia6821_device> m_ic11;
required_device<pia6821_device> m_ic2;
- required_device<dac_device> m_dac;
+ required_device<dac_4bit_r2r_device> m_dac;
required_ioport m_io_test;
required_ioport m_io_dsw0;
required_ioport m_io_dsw1;
@@ -428,7 +429,7 @@ TIMER_DEVICE_CALLBACK_MEMBER( hankin_state::timer_s )
{
m_timer_s[2]++;
offs_t offs = (m_timer_s[2] & 31) | (m_ic2a << 5);
- m_dac->write_unsigned8(m_p_prom[offs]<< 4);
+ m_dac->write(m_p_prom[offs]);
}
else
m_timer_s[2] = 0;
@@ -440,6 +441,7 @@ void hankin_state::machine_reset()
{
m_p_prom = memregion("roms")->base() + 0x1800;
m_vol = 0;
+ m_dac->set_output_gain(0, 0);
}
// PA0-3 = sound data from main cpu
@@ -453,7 +455,7 @@ WRITE8_MEMBER( hankin_state::ic2_a_w )
{
m_ic2a = data >> 4;
offs_t offs = (m_timer_s[2] & 31) | (m_ic2a << 5);
- m_dac->write_unsigned8(m_p_prom[offs]<< 4);
+ m_dac->write(m_p_prom[offs]);
}
// PB0-3 = preset on 74LS161
@@ -500,9 +502,10 @@ static MACHINE_CONFIG_START( hankin, hankin_state )
/* Sound */
MCFG_FRAGMENT_ADD( genpin_audio )
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("dac", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_4BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
/* Devices */
MCFG_DEVICE_ADD("ic10", PIA6821, 0)
diff --git a/src/mame/drivers/harddriv.cpp b/src/mame/drivers/harddriv.cpp
index 1ce2fe985e4..224e9b83062 100644
--- a/src/mame/drivers/harddriv.cpp
+++ b/src/mame/drivers/harddriv.cpp
@@ -324,13 +324,11 @@ Notes:
****************************************************************************/
-
#include "emu.h"
-#include "machine/watchdog.h"
-#include "sound/dac.h"
-#include "includes/slapstic.h"
#include "includes/harddriv.h"
-
+#include "includes/slapstic.h"
+#include "machine/watchdog.h"
+#include "sound/volt_reg.h"
#include "racedrivpan.lh"
/*************************************
@@ -354,8 +352,8 @@ harddriv_state::harddriv_state(const machine_config &mconfig, const char *tag, d
m_ds3xdsp(*this, "ds3xdsp"),
m_ds3sdsp_region(*this, "ds3sdsp"),
m_ds3xdsp_region(*this, "ds3xdsp"),
- m_ds3dac1(*this, "ds3dac1"),
- m_ds3dac2(*this, "ds3dac2"),
+ m_ldac(*this, "ldac"),
+ m_rdac(*this, "rdac"),
m_harddriv_sound(*this, "harddriv_sound"),
m_jsa(*this, "jsa"),
m_screen(*this, "screen"),
@@ -818,17 +816,16 @@ static INPUT_PORTS_START( harddriv )
PORT_BIT( 0xff, 0x80, IPT_SPECIAL )
PORT_START("mainpcb:12BADC.0") /* b80000 - 12 bit ADC 0 - steering wheel */
- PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX(0x10,0xf0) PORT_SENSITIVITY(25) PORT_KEYDELTA(5) PORT_NAME("Steering Wheel")
+ PORT_BIT( 0xfff, 0x800, IPT_PADDLE ) PORT_MINMAX(0x010,0xff0) PORT_SENSITIVITY(400) PORT_KEYDELTA(5) PORT_NAME("Steering Wheel")
PORT_START("mainpcb:12BADC.1") /* b80000 - 12 bit ADC 1 - force brake */
- PORT_BIT( 0xff, 0x00, IPT_PEDAL2 ) PORT_SENSITIVITY(25) PORT_KEYDELTA(40) PORT_REVERSE PORT_NAME("Force Brake")
+ PORT_BIT( 0xfff, 0x000, IPT_PEDAL2 ) PORT_SENSITIVITY(400) PORT_KEYDELTA(100) PORT_REVERSE PORT_NAME("Brake Pedal")
PORT_START("mainpcb:12BADC.2") /* b80000 - 12 bit ADC 2 */
- PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT( 0xfff, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("mainpcb:12BADC.3") /* b80000 - 12 bit ADC 3 */
- PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
-
+ PORT_BIT( 0xfff, IP_ACTIVE_LOW, IPT_UNUSED )
INPUT_PORTS_END
@@ -902,16 +899,16 @@ static INPUT_PORTS_START( racedriv )
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("mainpcb:12BADC.0") /* b80000 - 12 bit ADC 0 - steering wheel */
- PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX(0x10,0xf0) PORT_SENSITIVITY(25) PORT_KEYDELTA(5) PORT_NAME("Steering Wheel")
+ PORT_BIT( 0xfff, 0x800, IPT_PADDLE ) PORT_MINMAX(0x010,0xff0) PORT_SENSITIVITY(400) PORT_KEYDELTA(5) PORT_NAME("Steering Wheel")
PORT_START("mainpcb:12BADC.1") /* b80000 - 12 bit ADC 1 - force brake */
- PORT_BIT( 0xff, 0x00, IPT_PEDAL2 ) PORT_SENSITIVITY(25) PORT_KEYDELTA(40) PORT_REVERSE PORT_NAME("Force Brake")
+ PORT_BIT( 0xfff, 0x000, IPT_PEDAL2 ) PORT_SENSITIVITY(400) PORT_KEYDELTA(100) PORT_REVERSE PORT_NAME("Brake Pedal")
PORT_START("mainpcb:12BADC.2") /* b80000 - 12 bit ADC 2 */
- PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT( 0xfff, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("mainpcb:12BADC.3") /* b80000 - 12 bit ADC 3 */
- PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT( 0xfff, IP_ACTIVE_LOW, IPT_UNUSED )
INPUT_PORTS_END
static INPUT_PORTS_START( racedriv_pan )
@@ -1032,15 +1029,15 @@ static INPUT_PORTS_START( racedrivc )
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("mainpcb:12BADC.0") /* 400000 - steering wheel */
- PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX(0x10,0xf0) PORT_SENSITIVITY(25) PORT_KEYDELTA(5) PORT_NAME("Steering Wheel")
+ PORT_BIT(0xfff, 0x800, IPT_PADDLE) PORT_MINMAX(0x010, 0xff0) PORT_SENSITIVITY(400) PORT_KEYDELTA(5) PORT_NAME("Steering Wheel")
/* dummy ADC ports to end up with the same number as the full version */
PORT_START("mainpcb:12BADC.1")
- PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT( 0xfff, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("mainpcb:12BADC.2")
- PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT( 0xfff, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("mainpcb:12BADC.3")
- PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT( 0xfff, IP_ACTIVE_LOW, IPT_UNUSED )
INPUT_PORTS_END
@@ -1114,16 +1111,16 @@ static INPUT_PORTS_START( stunrun )
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("mainpcb:12BADC.0") /* b80000 - 12 bit ADC 0 */
- PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT( 0xfff, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("mainpcb:12BADC.1") /* b80000 - 12 bit ADC 1 */
- PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT( 0xfff, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("mainpcb:12BADC.2") /* b80000 - 12 bit ADC 2 */
- PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT( 0xfff, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("mainpcb:12BADC.3") /* b80000 - 12 bit ADC 3 */
- PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT( 0xfff, IP_ACTIVE_LOW, IPT_UNUSED )
/* stunrun has its own coins */
// todo
@@ -1204,16 +1201,16 @@ static INPUT_PORTS_START( steeltal )
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("mainpcb:12BADC.0") /* b80000 - 12 bit ADC 0 */
- PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) /* left/right */
+ PORT_BIT( 0xfff, 0x800, IPT_AD_STICK_X ) PORT_MINMAX(0x010, 0xff0) PORT_SENSITIVITY(400) PORT_KEYDELTA(10) /* left/right */
PORT_START("mainpcb:12BADC.1") /* b80000 - 12 bit ADC 1 */
- PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) /* up/down */
+ PORT_BIT( 0xfff, 0x800, IPT_AD_STICK_Y ) PORT_MINMAX(0x010, 0xff0) PORT_SENSITIVITY(400) PORT_KEYDELTA(10) /* up/down */
PORT_START("mainpcb:12BADC.2") /* b80000 - 12 bit ADC 2 */
- PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Z ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_NAME("Collective") PORT_REVERSE /* collective */
+ PORT_BIT( 0xfff, 0x800, IPT_AD_STICK_Z ) PORT_MINMAX(0x010, 0xff0) PORT_SENSITIVITY(400) PORT_KEYDELTA(10) PORT_NAME("Collective") PORT_REVERSE /* collective */
PORT_START("mainpcb:12BADC.3") /* b80000 - 12 bit ADC 3 */
- PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_NAME("Rudder") PORT_PLAYER(2) /* rudder */
+ PORT_BIT( 0xfff, 0x800, IPT_AD_STICK_X ) PORT_MINMAX(0x010, 0xff0) PORT_SENSITIVITY(400) PORT_KEYDELTA(10) PORT_NAME("Rudder") PORT_PLAYER(2) /* rudder */
/* steeltal has its own coins */
// todo
@@ -1301,15 +1298,15 @@ static INPUT_PORTS_START( strtdriv )
PORT_BIT( 0xff, 0x80, IPT_UNUSED )
PORT_START("mainpcb:12BADC.0") /* 400000 - steering wheel */
- PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX(0x10,0xf0) PORT_SENSITIVITY(25) PORT_KEYDELTA(5) PORT_NAME("Steering Wheel")
+ PORT_BIT(0xfff, 0x800, IPT_PADDLE) PORT_MINMAX(0x010, 0xff0) PORT_SENSITIVITY(400) PORT_KEYDELTA(5) PORT_NAME("Steering Wheel")
/* dummy ADC ports to end up with the same number as the full version */
PORT_START("mainpcb:12BADC.1") /* FAKE */
- PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT( 0xfff, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("mainpcb:12BADC.2") /* FAKE */
- PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT( 0xfff, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("mainpcb:12BADC.3") /* FAKE */
- PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT( 0xfff, IP_ACTIVE_LOW, IPT_UNUSED )
INPUT_PORTS_END
@@ -1391,15 +1388,15 @@ static INPUT_PORTS_START( hdrivair )
PORT_BIT( 0xff, 0x80, IPT_UNUSED )
PORT_START("mainpcb:12BADC.0") /* 400000 - steering wheel */
- PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX(0x10,0xf0) PORT_SENSITIVITY(25) PORT_KEYDELTA(5) PORT_REVERSE PORT_NAME("Steering Wheel")
+ PORT_BIT(0xfff, 0x800, IPT_PADDLE) PORT_MINMAX(0x010, 0xff0) PORT_SENSITIVITY(400) PORT_KEYDELTA(5) PORT_REVERSE PORT_NAME("Steering Wheel")
/* dummy ADC ports to end up with the same number as the full version */
PORT_START("mainpcb:12BADC.1")
- PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT( 0xfff, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("mainpcb:12BADC.2")
- PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT( 0xfff, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("mainpcb:12BADC.3")
- PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT( 0xfff, IP_ACTIVE_LOW, IPT_UNUSED )
INPUT_PORTS_END
@@ -1577,11 +1574,11 @@ static MACHINE_CONFIG_FRAGMENT( ds3 )
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
- MCFG_SOUND_ADD("ds3dac1", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
-
- MCFG_SOUND_ADD("ds3dac2", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
+ MCFG_SOUND_ADD("ldac", DAC_16BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) // unknown DAC
+ MCFG_SOUND_ADD("rdac", DAC_16BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "ldac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "ldac", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "rdac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "rdac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
@@ -1709,8 +1706,9 @@ static MACHINE_CONFIG_FRAGMENT( steeltal )
MCFG_FRAGMENT_ADD( ds3 ) /* DS III board */
MCFG_DEVICE_REMOVE("ds3sdsp") /* DS III sound components are not present */
MCFG_DEVICE_REMOVE("ds3xdsp")
- MCFG_DEVICE_REMOVE("ds3dac1")
- MCFG_DEVICE_REMOVE("ds3dac2")
+ MCFG_DEVICE_REMOVE("ldac")
+ MCFG_DEVICE_REMOVE("rdac")
+ MCFG_DEVICE_REMOVE("vref")
MCFG_DEVICE_REMOVE("lspeaker")
MCFG_DEVICE_REMOVE("rspeaker")
diff --git a/src/mame/drivers/hh_cop400.cpp b/src/mame/drivers/hh_cop400.cpp
index 0968a9e2501..d6590a10c99 100644
--- a/src/mame/drivers/hh_cop400.cpp
+++ b/src/mame/drivers/hh_cop400.cpp
@@ -14,8 +14,8 @@
#include "emu.h"
#include "cpu/cop400/cop400.h"
-#include "sound/speaker.h"
#include "sound/dac.h"
+#include "sound/volt_reg.h"
// internal artwork
#include "bship82.lh" // clickable
@@ -36,7 +36,6 @@ public:
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_inp_matrix(*this, "IN.%u", 0),
- m_speaker(*this, "speaker"),
m_display_wait(33),
m_display_maxy(1),
m_display_maxx(0)
@@ -45,7 +44,6 @@ public:
// devices
required_device<cpu_device> m_maincpu;
optional_ioport_array<5> m_inp_matrix; // max 5
- optional_device<speaker_sound_device> m_speaker;
// misc common
UINT8 m_l; // MCU port L write data
@@ -267,7 +265,6 @@ public:
DECLARE_WRITE8_MEMBER(write_g);
DECLARE_WRITE8_MEMBER(write_l);
- DECLARE_WRITE_LINE_MEMBER(write_sk);
DECLARE_READ8_MEMBER(read_l);
};
@@ -292,12 +289,6 @@ READ8_MEMBER(ctstein_state::read_l)
return read_inputs(3) << 4 | 0xf;
}
-WRITE_LINE_MEMBER(ctstein_state::write_sk)
-{
- // SK: speaker out
- m_speaker->level_w(state);
-}
-
// config
@@ -328,16 +319,17 @@ static MACHINE_CONFIG_START( ctstein, ctstein_state )
MCFG_COP400_CONFIG(COP400_CKI_DIVISOR_4, COP400_CKO_OSCILLATOR_OUTPUT, false) // guessed
MCFG_COP400_WRITE_G_CB(WRITE8(ctstein_state, write_g))
MCFG_COP400_WRITE_L_CB(WRITE8(ctstein_state, write_l))
- MCFG_COP400_WRITE_SK_CB(WRITELINE(ctstein_state, write_sk))
+ MCFG_COP400_WRITE_SK_CB(DEVWRITELINE("dac", dac_bit_interface, write))
MCFG_COP400_READ_L_CB(READ8(ctstein_state, read_l))
MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_cop400_state, display_decay_tick, attotime::from_msec(1))
MCFG_DEFAULT_LAYOUT(layout_ctstein)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT)
MACHINE_CONFIG_END
@@ -407,12 +399,6 @@ READ8_MEMBER(h2hbaskb_state::read_in)
return (read_inputs(4) & 7) | (m_inp_matrix[4]->read() & 8);
}
-WRITE_LINE_MEMBER(h2hbaskb_state::write_so)
-{
- // SO: speaker out
- m_speaker->level_w(state);
-}
-
// config
@@ -459,15 +445,16 @@ static MACHINE_CONFIG_START( h2hbaskb, h2hbaskb_state )
MCFG_COP400_WRITE_G_CB(WRITE8(h2hbaskb_state, write_g))
MCFG_COP400_WRITE_L_CB(WRITE8(h2hbaskb_state, write_l))
MCFG_COP400_READ_IN_CB(READ8(h2hbaskb_state, read_in))
- MCFG_COP400_WRITE_SO_CB(WRITELINE(h2hbaskb_state, write_so))
+ MCFG_COP400_WRITE_SO_CB(DEVWRITELINE("dac", dac_bit_interface, write))
MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_cop400_state, display_decay_tick, attotime::from_msec(1))
MCFG_DEFAULT_LAYOUT(layout_h2hbaskb)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT)
MACHINE_CONFIG_END
@@ -491,9 +478,12 @@ class einvaderc_state : public hh_cop400_state
{
public:
einvaderc_state(const machine_config &mconfig, device_type type, const char *tag)
- : hh_cop400_state(mconfig, type, tag)
+ : hh_cop400_state(mconfig, type, tag),
+ m_dac(*this, "dac")
{ }
+ required_device<dac_bit_interface> m_dac;
+
void prepare_display();
DECLARE_WRITE8_MEMBER(write_d);
DECLARE_WRITE8_MEMBER(write_g);
@@ -533,7 +523,7 @@ WRITE8_MEMBER(einvaderc_state::write_g)
WRITE_LINE_MEMBER(einvaderc_state::write_sk)
{
// SK: speaker out + led grid 8
- m_speaker->level_w(state);
+ m_dac->write(state);
m_sk = state;
prepare_display();
}
@@ -581,9 +571,10 @@ static MACHINE_CONFIG_START( einvaderc, einvaderc_state )
MCFG_DEFAULT_LAYOUT(layout_einvaderc)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT)
MACHINE_CONFIG_END
@@ -602,9 +593,12 @@ class funjacks_state : public hh_cop400_state
{
public:
funjacks_state(const machine_config &mconfig, device_type type, const char *tag)
- : hh_cop400_state(mconfig, type, tag)
+ : hh_cop400_state(mconfig, type, tag),
+ m_dac(*this, "dac")
{ }
+ required_device<dac_bit_interface> m_dac;
+
DECLARE_WRITE8_MEMBER(write_d);
DECLARE_WRITE8_MEMBER(write_l);
DECLARE_WRITE8_MEMBER(write_g);
@@ -632,7 +626,7 @@ WRITE8_MEMBER(funjacks_state::write_l)
WRITE8_MEMBER(funjacks_state::write_g)
{
// G1: speaker out
- m_speaker->level_w(data >> 1 & 1);
+ m_dac->write(BIT(data, 1));
m_g = data;
}
@@ -689,9 +683,10 @@ static MACHINE_CONFIG_START( funjacks, funjacks_state )
MCFG_DEFAULT_LAYOUT(layout_funjacks)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT)
MACHINE_CONFIG_END
@@ -714,9 +709,12 @@ class funrlgl_state : public hh_cop400_state
{
public:
funrlgl_state(const machine_config &mconfig, device_type type, const char *tag)
- : hh_cop400_state(mconfig, type, tag)
+ : hh_cop400_state(mconfig, type, tag),
+ m_dac(*this, "dac")
{ }
+ required_device<dac_bit_interface> m_dac;
+
DECLARE_WRITE8_MEMBER(write_d);
DECLARE_WRITE8_MEMBER(write_l);
DECLARE_WRITE8_MEMBER(write_g);
@@ -744,7 +742,7 @@ WRITE8_MEMBER(funrlgl_state::write_l)
WRITE8_MEMBER(funrlgl_state::write_g)
{
// G3: speaker out
- m_speaker->level_w(data >> 3 & 1);
+ m_dac->write(BIT(data, 3));
}
@@ -784,9 +782,10 @@ static MACHINE_CONFIG_START( funrlgl, funrlgl_state )
MCFG_DEFAULT_LAYOUT(layout_funrlgl)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT)
MACHINE_CONFIG_END
@@ -805,9 +804,12 @@ class plus1_state : public hh_cop400_state
{
public:
plus1_state(const machine_config &mconfig, device_type type, const char *tag)
- : hh_cop400_state(mconfig, type, tag)
+ : hh_cop400_state(mconfig, type, tag),
+ m_dac(*this, "dac")
{ }
+ required_device<dac_bit_interface> m_dac;
+
DECLARE_WRITE8_MEMBER(write_d);
};
@@ -816,7 +818,7 @@ public:
WRITE8_MEMBER(plus1_state::write_d)
{
// D?: speaker out
- m_speaker->level_w(data & 1);
+ m_dac->write(BIT(data, 0));
}
@@ -849,9 +851,10 @@ static MACHINE_CONFIG_START( plus1, plus1_state )
/* no visual feedback! */
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT)
MACHINE_CONFIG_END
@@ -889,7 +892,6 @@ public:
DECLARE_WRITE_LINE_MEMBER(write_so);
DECLARE_WRITE8_MEMBER(write_d);
DECLARE_WRITE8_MEMBER(write_l);
- DECLARE_WRITE_LINE_MEMBER(write_sk);
DECLARE_READ8_MEMBER(read_g);
};
@@ -923,12 +925,6 @@ WRITE8_MEMBER(lightfgt_state::write_l)
prepare_display();
}
-WRITE_LINE_MEMBER(lightfgt_state::write_sk)
-{
- // SK: speaker out
- m_speaker->level_w(state);
-}
-
READ8_MEMBER(lightfgt_state::read_g)
{
// G: multiplexed inputs
@@ -979,16 +975,17 @@ static MACHINE_CONFIG_START( lightfgt, lightfgt_state )
MCFG_COP400_WRITE_SO_CB(WRITELINE(lightfgt_state, write_so))
MCFG_COP400_WRITE_D_CB(WRITE8(lightfgt_state, write_d))
MCFG_COP400_WRITE_L_CB(WRITE8(lightfgt_state, write_l))
- MCFG_COP400_WRITE_SK_CB(WRITELINE(lightfgt_state, write_sk))
+ MCFG_COP400_WRITE_SK_CB(DEVWRITELINE("dac", dac_bit_interface, write))
MCFG_COP400_READ_G_CB(READ8(lightfgt_state, read_g))
MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_cop400_state, display_decay_tick, attotime::from_msec(1))
MCFG_DEFAULT_LAYOUT(layout_lightfgt)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT)
MACHINE_CONFIG_END
@@ -1008,14 +1005,10 @@ class bship82_state : public hh_cop400_state
{
public:
bship82_state(const machine_config &mconfig, device_type type, const char *tag)
- : hh_cop400_state(mconfig, type, tag),
- m_dac(*this, "dac")
+ : hh_cop400_state(mconfig, type, tag)
{ }
- required_device<dac_device> m_dac;
-
DECLARE_WRITE8_MEMBER(write_d);
- DECLARE_WRITE8_MEMBER(write_g);
DECLARE_READ8_MEMBER(read_l);
DECLARE_READ8_MEMBER(read_in);
DECLARE_WRITE_LINE_MEMBER(write_so);
@@ -1029,13 +1022,6 @@ WRITE8_MEMBER(bship82_state::write_d)
m_inp_mux = data;
}
-WRITE8_MEMBER(bship82_state::write_g)
-{
- // G: 4-bit signed DAC
- if (~data & 8) data ^= 7;
- m_dac->write_signed8(data << 4);
-}
-
READ8_MEMBER(bship82_state::read_l)
{
// L: multiplexed inputs
@@ -1118,13 +1104,31 @@ static INPUT_PORTS_START( bship82 )
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_TOGGLE PORT_CODE(KEYCODE_F1) PORT_NAME("Load/Go") // switch
INPUT_PORTS_END
+/*
+
+http://www.seanriddle.com/bship82.txt
+
+21 G0 3.9K resistor to speaker transistor base
+22 G1 2.2K resistor to speaker transistor base
+23 G2 1.0K resistor to speaker transistor base
+24 G3 speaker transistor base tied high 4.7K
+
+speaker connection
+2N3904 transistor:
+emitter to 10ohm resistor to ground
+collector to 68ohm resistor to speaker (other speaker terminal to VCC)
+base pulled high with 4.7K resistor, connects directly to G3, 1K resistor to G2,
+2.2K resistor to G1, 3.9K resistor to G0
+
+*/
+
static MACHINE_CONFIG_START( bship82, bship82_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", COP420, 3000000) // approximation - RC osc. R=14K, C=100pf
MCFG_COP400_CONFIG(COP400_CKI_DIVISOR_16, COP400_CKO_OSCILLATOR_OUTPUT, false) // guessed
MCFG_COP400_WRITE_D_CB(WRITE8(bship82_state, write_d))
- MCFG_COP400_WRITE_G_CB(WRITE8(bship82_state, write_g))
+ MCFG_COP400_WRITE_G_CB(DEVWRITE8("dac", dac_byte_interface, write)) // G: 4-bit signed DAC
MCFG_COP400_READ_L_CB(READ8(bship82_state, read_l))
MCFG_COP400_READ_IN_CB(READ8(bship82_state, read_in))
MCFG_COP400_WRITE_SO_CB(WRITELINE(bship82_state, write_so))
@@ -1134,9 +1138,10 @@ static MACHINE_CONFIG_START( bship82, bship82_state )
MCFG_DEFAULT_LAYOUT(layout_bship82)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_4BIT_BINARY_WEIGHTED_SIGN_MAGNITUDE, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.125) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/homedata.cpp b/src/mame/drivers/homedata.cpp
index e87e97fd98c..de8133351ba 100644
--- a/src/mame/drivers/homedata.cpp
+++ b/src/mame/drivers/homedata.cpp
@@ -234,11 +234,12 @@ Custom: GX61A01
***************************************************************************/
#include "emu.h"
-#include "cpu/z80/z80.h"
+#include "includes/homedata.h"
#include "cpu/m6809/m6809.h"
#include "cpu/upd7810/upd7810.h"
-#include "includes/homedata.h"
-
+#include "cpu/z80/z80.h"
+#include "sound/dac.h"
+#include "sound/volt_reg.h"
INTERRUPT_GEN_MEMBER(homedata_state::homedata_irq)
{
@@ -317,20 +318,6 @@ WRITE8_MEMBER(homedata_state::mrokumei_sound_bank_w)
m_sndbank = data;
}
-WRITE8_MEMBER(homedata_state::mrokumei_sound_io_w)
-{
- switch (offset & 0xff)
- {
- case 0x40:
- case 0x7f: // hourouki mirror
- m_dac->write_signed8(data);
- break;
- default:
- logerror("%04x: I/O write to port %04x %02x\n", space.device().safe_pc(), offset,data);
- break;
- }
-}
-
WRITE8_MEMBER(homedata_state::mrokumei_sound_cmd_w)
{
m_soundlatch->write(space, offset, data);
@@ -560,15 +547,15 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( mrokumei_sound_map, AS_PROGRAM, 8, homedata_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM
- // TODO: might be that the entire area is sound_bank_w
AM_RANGE(0xfffc, 0xfffd) AM_WRITENOP /* stack writes happen here, but there's no RAM */
AM_RANGE(0x8080, 0x8080) AM_WRITE(mrokumei_sound_bank_w)
- AM_RANGE(0xffbf, 0xffbf) AM_WRITE(mrokumei_sound_bank_w) // hourouki mirror
ADDRESS_MAP_END
-
static ADDRESS_MAP_START( mrokumei_sound_io_map, AS_IO, 8, homedata_state )
- AM_RANGE(0x0000, 0xffff) AM_READWRITE(mrokumei_sound_io_r, mrokumei_sound_io_w) /* read address is 16-bit, write address is only 8-bit */
+ AM_RANGE(0x0000, 0xffff) AM_READ(mrokumei_sound_io_r) /* read address is 16-bit */
+ AM_RANGE(0x0040, 0x0040) AM_MIRROR(0xff00) AM_DEVWRITE("dac", dac_byte_interface, write) /* write address is only 8-bit */
+ // hourouki mirror...
+ AM_RANGE(0x007f, 0x007f) AM_MIRROR(0xff00) AM_DEVWRITE("dac", dac_byte_interface, write) /* write address is only 8-bit */
ADDRESS_MAP_END
/********************************************************************************/
@@ -599,7 +586,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( reikaids_upd7807_io_map, AS_IO, 8, homedata_state )
AM_RANGE(UPD7807_PORTA, UPD7807_PORTA) AM_READWRITE(reikaids_upd7807_porta_r, reikaids_upd7807_porta_w)
- AM_RANGE(UPD7807_PORTB, UPD7807_PORTB) AM_DEVWRITE("dac", dac_device, write_signed8)
+ AM_RANGE(UPD7807_PORTB, UPD7807_PORTB) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(UPD7807_PORTC, UPD7807_PORTC) AM_WRITE(reikaids_upd7807_portc_w)
AM_RANGE(UPD7807_PORTT, UPD7807_PORTT) AM_READ(reikaids_snd_command_r)
ADDRESS_MAP_END
@@ -634,7 +621,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( pteacher_upd7807_io_map, AS_IO, 8, homedata_state )
AM_RANGE(UPD7807_PORTA, UPD7807_PORTA) AM_READWRITE(pteacher_upd7807_porta_r, pteacher_upd7807_porta_w)
- AM_RANGE(UPD7807_PORTB, UPD7807_PORTB) AM_DEVWRITE("dac", dac_device, write_signed8)
+ AM_RANGE(UPD7807_PORTB, UPD7807_PORTB) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(UPD7807_PORTC, UPD7807_PORTC) AM_READ_PORT("COIN") AM_WRITE(pteacher_upd7807_portc_w)
AM_RANGE(UPD7807_PORTT, UPD7807_PORTT) AM_READ(pteacher_keyboard_r)
ADDRESS_MAP_END
@@ -1264,15 +1251,16 @@ static MACHINE_CONFIG_START( mrokumei, homedata_state )
MCFG_VIDEO_START_OVERRIDE(homedata_state,mrokumei)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("snsnd", SN76489A, 16000000/4) // SN76489AN actually
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
@@ -1312,18 +1300,19 @@ static MACHINE_CONFIG_START( reikaids, homedata_state )
MCFG_VIDEO_START_OVERRIDE(homedata_state,reikaids)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_SOUND_ADD("ymsnd", YM2203, 3000000)
MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW1"))
MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSW2"))
- MCFG_SOUND_ROUTE(0, "mono", 0.25)
- MCFG_SOUND_ROUTE(1, "mono", 0.25)
- MCFG_SOUND_ROUTE(2, "mono", 0.25)
- MCFG_SOUND_ROUTE(3, "mono", 1.0)
-
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
+ MCFG_SOUND_ROUTE(0, "speaker", 0.25)
+ MCFG_SOUND_ROUTE(1, "speaker", 0.25)
+ MCFG_SOUND_ROUTE(2, "speaker", 0.25)
+ MCFG_SOUND_ROUTE(3, "speaker", 1.0)
+
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.4) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
@@ -1364,13 +1353,14 @@ static MACHINE_CONFIG_START( pteacher, homedata_state )
MCFG_VIDEO_START_OVERRIDE(homedata_state,pteacher)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_SOUND_ADD("snsnd", SN76489A, 16000000/4) // SN76489AN actually
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( mjkinjas, pteacher )
@@ -1527,13 +1517,13 @@ static MACHINE_CONFIG_START( mirderby, homedata_state )
MCFG_VIDEO_START_OVERRIDE(homedata_state,mirderby)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_SOUND_ADD("ymsnd", YM2203, 2000000)
- MCFG_SOUND_ROUTE(0, "mono", 0.25)
- MCFG_SOUND_ROUTE(1, "mono", 0.25)
- MCFG_SOUND_ROUTE(2, "mono", 0.25)
- MCFG_SOUND_ROUTE(3, "mono", 1.0)
+ MCFG_SOUND_ROUTE(0, "speaker", 0.25)
+ MCFG_SOUND_ROUTE(1, "speaker", 0.25)
+ MCFG_SOUND_ROUTE(2, "speaker", 0.25)
+ MCFG_SOUND_ROUTE(3, "speaker", 1.0)
MACHINE_CONFIG_END
/**************************************************************************/
diff --git a/src/mame/drivers/homelab.cpp b/src/mame/drivers/homelab.cpp
index 975f15ddd95..165537897b2 100644
--- a/src/mame/drivers/homelab.cpp
+++ b/src/mame/drivers/homelab.cpp
@@ -34,12 +34,12 @@ MB7051 - fuse programmed prom.
#include "emu.h"
#include "cpu/z80/z80.h"
-#include "sound/speaker.h"
-#include "sound/wave.h"
#include "imagedev/cassette.h"
-#include "audio/mea8000.h"
-#include "sound/dac.h"
#include "imagedev/snapquik.h"
+#include "sound/dac.h"
+#include "sound/mea8000.h"
+#include "sound/volt_reg.h"
+#include "sound/wave.h"
@@ -48,9 +48,9 @@ class homelab_state : public driver_device
public:
homelab_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
- m_maincpu(*this, "maincpu"),
- m_speaker(*this, "speaker"),
- m_cass(*this, "cassette")
+ m_maincpu(*this, "maincpu"),
+ m_dac(*this, "dac"),
+ m_cass(*this, "cassette")
{ }
DECLARE_READ8_MEMBER(key_r);
@@ -66,7 +66,7 @@ public:
const UINT8 *m_p_videoram;
bool m_nmi;
required_device<cpu_device> m_maincpu;
- required_device<speaker_sound_device> m_speaker;
+ required_device<dac_bit_interface> m_dac;
required_device<cassette_image_device> m_cass;
DECLARE_DRIVER_INIT(brailab4);
DECLARE_VIDEO_START(homelab2);
@@ -171,13 +171,13 @@ READ8_MEMBER( homelab_state::exxx_r )
else
if (offset == 0x80)
{
- m_speaker->level_w(0);
+ m_dac->write(0);
m_cass->output(-1.0);
}
else
if (offset == 0x02)
{
- m_speaker->level_w(1);
+ m_dac->write(1);
m_cass->output(+1.0);
}
@@ -750,11 +750,13 @@ static MACHINE_CONFIG_START( homelab, homelab_state )
MCFG_PALETTE_ADD_MONOCHROME("palette")
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT)
+
MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
MCFG_CASSETTE_ADD( "cassette" )
MCFG_QUICKLOAD_ADD("quickload", homelab_state, homelab, "htp", 2)
@@ -781,11 +783,13 @@ static MACHINE_CONFIG_START( homelab3, homelab_state )
MCFG_PALETTE_ADD_MONOCHROME("palette")
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT)
+
MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
MCFG_CASSETTE_ADD( "cassette" )
MCFG_QUICKLOAD_ADD("quickload", homelab_state, homelab, "htp", 2)
@@ -812,15 +816,16 @@ static MACHINE_CONFIG_START( brailab4, homelab_state )
MCFG_PALETTE_ADD_MONOCHROME("palette")
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT)
+
MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
- MCFG_SOUND_ADD ( "speech", DAC, 0 )
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
- MCFG_DEVICE_ADD("mea8000", MEA8000, 0)
- MCFG_MEA8000_DAC("speech")
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
+
+ MCFG_SOUND_ADD("mea8000", MEA8000, 3840000)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MCFG_CASSETTE_ADD( "cassette" )
MCFG_QUICKLOAD_ADD("quickload", homelab_state, homelab, "htp", 18)
diff --git a/src/mame/drivers/hp48.cpp b/src/mame/drivers/hp48.cpp
index 317389522fc..a49c56c8ade 100644
--- a/src/mame/drivers/hp48.cpp
+++ b/src/mame/drivers/hp48.cpp
@@ -9,11 +9,10 @@
**********************************************************************/
#include "emu.h"
+#include "includes/hp48.h"
#include "cpu/saturn/saturn.h"
-#include "sound/dac.h"
#include "machine/nvram.h"
-
-#include "includes/hp48.h"
+#include "sound/volt_reg.h"
/* TODO:
- IR I/O port
@@ -1280,9 +1279,10 @@ static MACHINE_CONFIG_START( hp48_common, hp48_state )
MCFG_PALETTE_INIT_OWNER(hp48_state, hp48)
/* sound */
- MCFG_SPEAKER_STANDARD_MONO( "mono" )
- MCFG_SOUND_ADD( "dac", DAC, 0 )
- MCFG_SOUND_ROUTE( ALL_OUTPUTS, "mono", 1.) /* 1-bit beeper */
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( hp48gx, hp48_common )
diff --git a/src/mame/drivers/hyhoo.cpp b/src/mame/drivers/hyhoo.cpp
index 64fcee9eda1..270e7285daa 100644
--- a/src/mame/drivers/hyhoo.cpp
+++ b/src/mame/drivers/hyhoo.cpp
@@ -24,11 +24,12 @@ Memo:
******************************************************************************/
#include "emu.h"
+#include "includes/hyhoo.h"
#include "cpu/z80/z80.h"
+#include "machine/nvram.h"
#include "sound/ay8910.h"
#include "sound/dac.h"
-#include "includes/hyhoo.h"
-#include "machine/nvram.h"
+#include "sound/volt_reg.h"
static ADDRESS_MAP_START( hyhoo_map, AS_PROGRAM, 8, hyhoo_state )
@@ -47,7 +48,7 @@ static ADDRESS_MAP_START( hyhoo_io_map, AS_IO, 8, hyhoo_state )
AM_RANGE(0xa0, 0xa0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, inputport1_r, inputportsel_w)
AM_RANGE(0xb0, 0xb0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, inputport2_r, sndrombank1_w)
AM_RANGE(0xc0, 0xcf) AM_WRITEONLY AM_SHARE("clut")
- AM_RANGE(0xd0, 0xd0) AM_READNOP AM_DEVWRITE("dac", dac_device, write_unsigned8) // unknown read
+ AM_RANGE(0xd0, 0xd0) AM_READNOP AM_DEVWRITE("dac", dac_byte_interface, write) // unknown read
AM_RANGE(0xe0, 0xe0) AM_WRITE(hyhoo_romsel_w)
AM_RANGE(0xe0, 0xe1) AM_DEVREAD("nb1413m3", nb1413m3_device, gfxrom_r)
AM_RANGE(0xf0, 0xf0) AM_DEVREAD("nb1413m3", nb1413m3_device, dipsw1_r)
@@ -244,14 +245,16 @@ static MACHINE_CONFIG_START( hyhoo, hyhoo_state )
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_SOUND_ADD("aysnd", AY8910, 1250000)
MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSWA"))
MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSWB"))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.35)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.35)
+
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/hyperspt.cpp b/src/mame/drivers/hyperspt.cpp
index fcdb0081961..8319f084f42 100644
--- a/src/mame/drivers/hyperspt.cpp
+++ b/src/mame/drivers/hyperspt.cpp
@@ -9,18 +9,19 @@ Based on drivers from Juno First emulator by Chris Hardy (chrish@kcbbs.gen.nz)
***************************************************************************/
#include "emu.h"
-#include "cpu/z80/z80.h"
+#include "includes/konamipt.h"
+#include "includes/hyperspt.h"
+#include "audio/trackfld.h"
+#include "audio/hyprolyb.h"
#include "cpu/m6800/m6800.h"
#include "cpu/m6809/m6809.h"
-#include "sound/dac.h"
+#include "cpu/z80/z80.h"
+#include "machine/gen_latch.h"
#include "machine/konami1.h"
#include "machine/nvram.h"
-#include "machine/gen_latch.h"
#include "machine/watchdog.h"
-#include "includes/konamipt.h"
-#include "audio/trackfld.h"
-#include "audio/hyprolyb.h"
-#include "includes/hyperspt.h"
+#include "sound/dac.h"
+#include "sound/volt_reg.h"
WRITE8_MEMBER(hyperspt_state::hyperspt_coin_counter_w)
@@ -82,7 +83,7 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, hyperspt_state )
AM_RANGE(0x8000, 0x8000) AM_DEVREAD("trackfld_audio", trackfld_audio_device, hyperspt_sh_timer_r)
AM_RANGE(0xa000, 0xa000) AM_DEVWRITE("vlm", vlm5030_device, data_w) /* speech data */
AM_RANGE(0xc000, 0xdfff) AM_DEVWRITE("trackfld_audio", trackfld_audio_device, hyperspt_sound_w) /* speech and output control */
- AM_RANGE(0xe000, 0xe000) AM_DEVWRITE("dac", dac_device, write_unsigned8)
+ AM_RANGE(0xe000, 0xe000) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(0xe001, 0xe001) AM_WRITE(konami_SN76496_latch_w) /* Loads the snd command into the snd latch */
AM_RANGE(0xe002, 0xe002) AM_WRITE(konami_SN76496_w) /* This address triggers the SN chip to read the data port. */
ADDRESS_MAP_END
@@ -94,7 +95,7 @@ static ADDRESS_MAP_START( roadf_sound_map, AS_PROGRAM, 8, hyperspt_state )
AM_RANGE(0x8000, 0x8000) AM_DEVREAD("trackfld_audio", trackfld_audio_device, hyperspt_sh_timer_r)
AM_RANGE(0xa000, 0xa000) AM_NOP // No VLM
AM_RANGE(0xc000, 0xdfff) AM_NOP // No VLM
- AM_RANGE(0xe000, 0xe000) AM_DEVWRITE("dac", dac_device, write_unsigned8)
+ AM_RANGE(0xe000, 0xe000) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(0xe001, 0xe001) AM_WRITE(konami_SN76496_latch_w) /* Loads the snd command into the snd latch */
AM_RANGE(0xe002, 0xe002) AM_WRITE(konami_SN76496_w) /* This address triggers the SN chip to read the data port. */
ADDRESS_MAP_END
@@ -106,7 +107,7 @@ static ADDRESS_MAP_START( soundb_map, AS_PROGRAM, 8, hyperspt_state )
AM_RANGE(0x8000, 0x8000) AM_DEVREAD("trackfld_audio", trackfld_audio_device, hyperspt_sh_timer_r)
AM_RANGE(0xa000, 0xa000) AM_NOP
AM_RANGE(0xc000, 0xdfff) AM_DEVWRITE("hyprolyb_adpcm", hyprolyb_adpcm_device, write) /* speech and output control */
- AM_RANGE(0xe000, 0xe000) AM_DEVWRITE("dac", dac_device, write_unsigned8)
+ AM_RANGE(0xe000, 0xe000) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(0xe001, 0xe001) AM_WRITE(konami_SN76496_latch_w) /* Loads the snd command into the snd latch */
AM_RANGE(0xe002, 0xe002) AM_WRITE(konami_SN76496_w) /* This address triggers the SN chip to read the data port. */
ADDRESS_MAP_END
@@ -320,20 +321,21 @@ static MACHINE_CONFIG_START( hyperspt, hyperspt_state )
MCFG_PALETTE_INIT_OWNER(hyperspt_state, hyperspt)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("trackfld_audio", TRACKFLD_AUDIO, 0)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.4) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MCFG_SOUND_ADD("snsnd", SN76496, XTAL_14_31818MHz/8) /* verified on pcb */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MCFG_SOUND_ADD("vlm", VLM5030, XTAL_3_579545MHz) /* verified on pcb */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/indy_indigo2.cpp b/src/mame/drivers/indy_indigo2.cpp
index e913ee22045..6961eb442d4 100644
--- a/src/mame/drivers/indy_indigo2.cpp
+++ b/src/mame/drivers/indy_indigo2.cpp
@@ -50,6 +50,7 @@
#include "machine/pit8253.h"
#include "video/newport.h"
#include "sound/dac.h"
+#include "sound/volt_reg.h"
#include "bus/scsi/scsi.h"
#include "bus/scsi/scsicd.h"
#include "bus/scsi/scsihd.h"
@@ -196,7 +197,7 @@ protected:
required_device<pit8254_device> m_pit;
required_device<sgi_mc_device> m_sgi_mc;
required_device<newport_video_device> m_newport;
- required_device<dac_device> m_dac;
+ required_device<dac_word_interface> m_dac;
required_device<kbdc8042_device> m_kbdc8042;
required_device<ioc2_device> m_ioc2;
required_device<ds1386_device> m_rtc;
@@ -792,7 +793,7 @@ TIMER_CALLBACK_MEMBER(ip22_state::ip22_dma)
UINT16 temp16 = ( m_mainram[(m_pbus_dma.m_cur_ptr - 0x08000000)/4] & 0xffff0000 ) >> 16;
INT16 stemp16 = (INT16)((temp16 >> 8) | (temp16 << 8));
- m_dac->write_signed16(stemp16 ^ 0x8000);
+ m_dac->write_signed16(stemp16);
m_pbus_dma.m_cur_ptr += 4;
@@ -1249,8 +1250,9 @@ static MACHINE_CONFIG_START( ip225015, ip22_state )
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
- MCFG_SOUND_ADD( "dac", DAC, 0 )
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.5)
+ MCFG_SOUND_ADD("dac", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.25) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.25) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MCFG_DEVICE_ADD("scsi", SCSI_PORT, 0)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE1, "harddisk", SCSIHD, SCSI_ID_1)
diff --git a/src/mame/drivers/iris3130.cpp b/src/mame/drivers/iris3130.cpp
index 47d8c0fb9b1..11ace305b2f 100644
--- a/src/mame/drivers/iris3130.cpp
+++ b/src/mame/drivers/iris3130.cpp
@@ -40,7 +40,6 @@
#include "emu.h"
#include "bus/rs232/rs232.h"
-#include "sound/dac.h"
#include "cpu/m68000/m68000.h"
#include "machine/mc146818.h" /* TOD clock */
#include "machine/mc68681.h" /* DUART0, DUART1 */
@@ -436,11 +435,6 @@ static MACHINE_CONFIG_START( sgi_ip2, sgi_ip2_state )
MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, "terminal")
MCFG_RS232_RXD_HANDLER(DEVWRITELINE("duart68681a", mc68681_device, rx_b_w))
MCFG_DEVICE_CARD_DEVICE_INPUT_DEFAULTS("terminal", ip2_terminal)
-
- /* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD( "dac", DAC, 0 )
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
MACHINE_CONFIG_END
static INPUT_PORTS_START( sgi_ip2 )
diff --git a/src/mame/drivers/jaguar.cpp b/src/mame/drivers/jaguar.cpp
index f9fa040576f..a008d2eaaa2 100644
--- a/src/mame/drivers/jaguar.cpp
+++ b/src/mame/drivers/jaguar.cpp
@@ -333,21 +333,20 @@ Notes:
#include "emu.h"
+#include "includes/jaguar.h"
+#include "bus/generic/slot.h"
+#include "bus/generic/carts.h"
#include "cpu/m68000/m68000.h"
#include "cpu/mips/r3000.h"
#include "cpu/jaguar/jaguar.h"
-#include "machine/vt83c461.h"
-#include "sound/dac.h"
-#include "includes/jaguar.h"
+#include "imagedev/chd_cd.h"
#include "imagedev/snapquik.h"
-#include "sound/dac.h"
#include "machine/eepromser.h"
#include "machine/watchdog.h"
+#include "machine/vt83c461.h"
#include "sound/cdda.h"
+#include "sound/volt_reg.h"
#include "cdrom.h"
-#include "imagedev/chd_cd.h"
-#include "bus/generic/slot.h"
-#include "bus/generic/carts.h"
#include "softlist.h"
#define COJAG_CLOCK XTAL_52MHz
@@ -1831,12 +1830,11 @@ static MACHINE_CONFIG_START( cojagr3k, jaguar_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
-
- MCFG_DAC_ADD("dac1")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
-
- MCFG_DAC_ADD("dac2")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
+ MCFG_SOUND_ADD("ldac", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) // unknown DAC
+ MCFG_SOUND_ADD("rdac", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "ldac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "ldac", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "rdac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "rdac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( cojagr3k_rom, cojagr3k )
@@ -1877,10 +1875,11 @@ static MACHINE_CONFIG_START( jaguar, jaguar_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
- MCFG_DAC_ADD("dac1")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_DAC_ADD("dac2")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
+ MCFG_SOUND_ADD("ldac", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) // unknown DAC
+ MCFG_SOUND_ADD("rdac", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "ldac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "ldac", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "rdac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "rdac", -1.0, DAC_VREF_NEG_INPUT)
/* quickload */
MCFG_QUICKLOAD_ADD("quickload", jaguar_state, jaguar, "abs,bin,cof,jag,prg", 2)
diff --git a/src/mame/drivers/jankenmn.cpp b/src/mame/drivers/jankenmn.cpp
index 085f30db0ff..f504b477348 100644
--- a/src/mame/drivers/jankenmn.cpp
+++ b/src/mame/drivers/jankenmn.cpp
@@ -153,7 +153,7 @@
#include "machine/z80ctc.h"
#include "machine/i8255.h"
#include "sound/dac.h"
-
+#include "sound/volt_reg.h"
#include "jankenmn.lh"
@@ -375,7 +375,7 @@ static MACHINE_CONFIG_START( jankenmn, jankenmn_state )
MCFG_DEVICE_ADD("ppi8255_1", I8255, 0)
/* (20-23) Mode 0 - Ports A, B, high C & low C set as output. */
- MCFG_I8255_OUT_PORTA_CB(DEVWRITE8("dac", dac_device, write_unsigned8))
+ MCFG_I8255_OUT_PORTA_CB(DEVWRITE8("dac", dac_byte_interface, write))
MCFG_I8255_OUT_PORTB_CB(WRITE8(jankenmn_state, lamps1_w))
MCFG_I8255_OUT_PORTC_CB(WRITE8(jankenmn_state, lamps2_w))
@@ -385,11 +385,11 @@ static MACHINE_CONFIG_START( jankenmn, jankenmn_state )
/* NO VIDEO */
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
-
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/joctronic.cpp b/src/mame/drivers/joctronic.cpp
index 643ed02cfda..368dafccd58 100644
--- a/src/mame/drivers/joctronic.cpp
+++ b/src/mame/drivers/joctronic.cpp
@@ -9,7 +9,6 @@
#include "cpu/z80/z80.h"
#include "machine/z80ctc.h"
#include "sound/ay8910.h"
-#include "sound/dac.h"
class joctronic_state : public genpin_class
{
diff --git a/src/mame/drivers/juicebox.cpp b/src/mame/drivers/juicebox.cpp
index a024b893759..12b7749f2d7 100644
--- a/src/mame/drivers/juicebox.cpp
+++ b/src/mame/drivers/juicebox.cpp
@@ -13,6 +13,7 @@
#include "machine/s3c44b0.h"
#include "machine/smartmed.h"
#include "sound/dac.h"
+#include "sound/volt_reg.h"
#include "rendlay.h"
#include "softlist.h"
@@ -34,13 +35,11 @@ public:
juicebox_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
- m_dac(*this, "dac"),
m_s3c44b0(*this, "s3c44b0"),
m_smartmedia(*this, "smartmedia")
{ }
required_device<cpu_device> m_maincpu;
- required_device<dac_device> m_dac;
required_device<s3c44b0_device> m_s3c44b0;
required_device<smartmedia_image_device> m_smartmedia;
UINT32 port[9];
@@ -240,13 +239,6 @@ WRITE32_MEMBER(juicebox_state::juicebox_nand_w)
if (ACCESSING_BITS_24_31) smc_write((data >> 24) & 0xFF);
}
-// I2S
-
-WRITE16_MEMBER(juicebox_state::s3c44b0_i2s_data_w )
-{
- m_dac->write_signed16(data ^ 0x8000);
-}
-
// ...
INPUT_CHANGED_MEMBER(juicebox_state::port_changed)
@@ -321,15 +313,15 @@ static MACHINE_CONFIG_START( juicebox, juicebox_state )
MCFG_SCREEN_UPDATE_DEVICE("s3c44b0", s3c44b0_device, video_update)
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("dac", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
-
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MCFG_DEVICE_ADD("s3c44b0", S3C44B0, 10000000)
MCFG_S3C44B0_GPIO_PORT_R_CB(READ32(juicebox_state, s3c44b0_gpio_port_r))
MCFG_S3C44B0_GPIO_PORT_W_CB(WRITE32(juicebox_state, s3c44b0_gpio_port_w))
- MCFG_S3C44B0_I2S_DATA_W_CB(WRITE16(juicebox_state, s3c44b0_i2s_data_w))
+ MCFG_S3C44B0_I2S_DATA_W_CB(DEVWRITE16("dac", dac_word_interface, write))
MCFG_DEVICE_ADD("smartmedia", SMARTMEDIA, 0)
diff --git a/src/mame/drivers/junofrst.cpp b/src/mame/drivers/junofrst.cpp
index af23aeba49b..a3fe2a21ede 100644
--- a/src/mame/drivers/junofrst.cpp
+++ b/src/mame/drivers/junofrst.cpp
@@ -80,17 +80,18 @@ Blitter source graphics
#include "emu.h"
+#include "includes/konamipt.h"
+#include "includes/tutankhm.h"
#include "cpu/m6809/m6809.h"
#include "cpu/mcs48/mcs48.h"
#include "cpu/z80/z80.h"
#include "machine/gen_latch.h"
+#include "machine/konami1.h"
#include "machine/watchdog.h"
#include "sound/ay8910.h"
#include "sound/dac.h"
#include "sound/flt_rc.h"
-#include "machine/konami1.h"
-#include "includes/konamipt.h"
-#include "includes/tutankhm.h"
+#include "sound/volt_reg.h"
class junofrst_state : public tutankhm_state
@@ -333,7 +334,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( mcu_io_map, AS_IO, 8, junofrst_state )
AM_RANGE(0x00, 0xff) AM_DEVREAD("soundlatch2", generic_latch_8_device, read)
- AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_DEVWRITE("dac", dac_device, write_unsigned8)
+ AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_WRITE(i8039_irqen_and_status_w)
ADDRESS_MAP_END
@@ -439,7 +440,7 @@ static MACHINE_CONFIG_START( junofrst, junofrst_state )
MCFG_SCREEN_UPDATE_DRIVER(junofrst_state, screen_update_tutankhm)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
@@ -451,15 +452,16 @@ static MACHINE_CONFIG_START( junofrst, junofrst_state )
MCFG_SOUND_ROUTE(1, "filter.0.1", 0.30)
MCFG_SOUND_ROUTE(2, "filter.0.2", 0.30)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MCFG_FILTER_RC_ADD("filter.0.0", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MCFG_FILTER_RC_ADD("filter.0.1", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MCFG_FILTER_RC_ADD("filter.0.2", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/kchamp.cpp b/src/mame/drivers/kchamp.cpp
index 84a9831a699..e8f9b0deec9 100644
--- a/src/mame/drivers/kchamp.cpp
+++ b/src/mame/drivers/kchamp.cpp
@@ -65,10 +65,10 @@ IO ports and memory map changes. Dip switches differ too.
***************************************************************************/
#include "emu.h"
+#include "includes/kchamp.h"
#include "cpu/z80/z80.h"
#include "sound/ay8910.h"
-#include "sound/dac.h"
-#include "includes/kchamp.h"
+#include "sound/volt_reg.h"
/********************
@@ -156,8 +156,8 @@ WRITE8_MEMBER(kchamp_state::kc_sound_control_w)
{
if (offset == 0)
m_sound_nmi_enable = ((data >> 7) & 1);
-// else
-// DAC_set_volume(0, (data == 1) ? 255 : 0, 0);
+ else
+ m_dac->set_output_gain(0, BIT(data,0) ? 1.0 : 0);
}
static ADDRESS_MAP_START( kchamp_map, AS_PROGRAM, 8, kchamp_state )
@@ -188,7 +188,7 @@ static ADDRESS_MAP_START( kchamp_sound_io_map, AS_IO, 8, kchamp_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x01) AM_DEVWRITE("ay1", ay8910_device, data_address_w)
AM_RANGE(0x02, 0x03) AM_DEVWRITE("ay2", ay8910_device, data_address_w)
- AM_RANGE(0x04, 0x04) AM_DEVWRITE("dac", dac_device, write_unsigned8)
+ AM_RANGE(0x04, 0x04) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(0x05, 0x05) AM_WRITE(kc_sound_control_w)
AM_RANGE(0x06, 0x06) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
ADDRESS_MAP_END
@@ -428,20 +428,20 @@ static MACHINE_CONFIG_START( kchampvs, kchamp_state )
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("ay1", AY8910, XTAL_12MHz/8) /* verified on pcb */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.3)
MCFG_SOUND_ADD("ay2", AY8910, XTAL_12MHz/8) /* verified on pcb */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.3)
MCFG_SOUND_ADD("msm", MSM5205, 375000) /* verified on pcb, discrete circuit clock */
MCFG_MSM5205_VCLK_CB(WRITELINE(kchamp_state, msmint)) /* interrupt function */
MCFG_MSM5205_PRESCALER_SELECTOR(MSM5205_S96_4B) /* 1 / 96 = 3906.25Hz playback */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
/********************
@@ -480,18 +480,19 @@ static MACHINE_CONFIG_START( kchamp, kchamp_state )
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("ay1", AY8910, XTAL_12MHz/12) /* Guess based on actual pcb recordings of karatedo */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.3)
MCFG_SOUND_ADD("ay2", AY8910, XTAL_12MHz/12) /* Guess based on actual pcb recordings of karatedo */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.3)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.15) /* guess: using volume 0.50 makes the sound to clip a lot */
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.3) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/kim1.cpp b/src/mame/drivers/kim1.cpp
index 50e3e36ef2c..a599c7959b4 100644
--- a/src/mame/drivers/kim1.cpp
+++ b/src/mame/drivers/kim1.cpp
@@ -253,11 +253,6 @@ static MACHINE_CONFIG_START( kim1, kim1_state )
// video hardware
MCFG_DEFAULT_LAYOUT( layout_kim1 )
- // sound hardware
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("dac", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
-
// devices
MCFG_DEVICE_ADD("miot_u2", MOS6530, 1000000)
MCFG_MOS6530_IN_PA_CB(READ8(kim1_state, kim1_u2_read_a))
diff --git a/src/mame/drivers/kingobox.cpp b/src/mame/drivers/kingobox.cpp
index 3fc9c6f496c..de077e75212 100644
--- a/src/mame/drivers/kingobox.cpp
+++ b/src/mame/drivers/kingobox.cpp
@@ -18,10 +18,11 @@ Main CPU:
***************************************************************************/
#include "emu.h"
+#include "includes/kingobox.h"
#include "cpu/z80/z80.h"
#include "sound/ay8910.h"
#include "sound/dac.h"
-#include "includes/kingobox.h"
+#include "sound/volt_reg.h"
WRITE8_MEMBER(kingofb_state::video_interrupt_w)
{
@@ -92,7 +93,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( kingobox_sound_io_map, AS_IO, 8, kingofb_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x00, 0x00) AM_DEVWRITE("dac", dac_device, write_unsigned8)
+ AM_RANGE(0x00, 0x00) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(0x08, 0x08) AM_DEVREADWRITE("aysnd", ay8910_device, data_r, data_w)
AM_RANGE(0x0c, 0x0c) AM_DEVWRITE("aysnd", ay8910_device, address_w)
ADDRESS_MAP_END
@@ -137,7 +138,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( ringking_sound_io_map, AS_IO, 8, kingofb_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x00, 0x00) AM_DEVWRITE("dac", dac_device, write_unsigned8)
+ AM_RANGE(0x00, 0x00) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(0x02, 0x02) AM_DEVREAD("aysnd", ay8910_device, data_r)
AM_RANGE(0x02, 0x03) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
ADDRESS_MAP_END
@@ -494,16 +495,17 @@ static MACHINE_CONFIG_START( kingofb, kingofb_state )
MCFG_VIDEO_START_OVERRIDE(kingofb_state,kingofb)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("aysnd", AY8910, 1500000)
MCFG_AY8910_PORT_A_READ_CB(DEVREAD8("soundlatch", generic_latch_8_device, read))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.125) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
@@ -547,16 +549,17 @@ static MACHINE_CONFIG_START( ringking, kingofb_state )
MCFG_VIDEO_START_OVERRIDE(kingofb_state,ringking)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("aysnd", AY8910, 1500000)
MCFG_AY8910_PORT_A_READ_CB(DEVREAD8("soundlatch", generic_latch_8_device, read))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.125) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/ksayakyu.cpp b/src/mame/drivers/ksayakyu.cpp
index 15707b5314d..d54dedb4657 100644
--- a/src/mame/drivers/ksayakyu.cpp
+++ b/src/mame/drivers/ksayakyu.cpp
@@ -66,10 +66,11 @@ SRAM:
*/
#include "emu.h"
+#include "includes/ksayakyu.h"
#include "cpu/z80/z80.h"
#include "sound/ay8910.h"
#include "sound/dac.h"
-#include "includes/ksayakyu.h"
+#include "sound/volt_reg.h"
#define MAIN_CLOCK XTAL_18_432MHz
@@ -127,7 +128,7 @@ static ADDRESS_MAP_START( soundcpu_map, AS_PROGRAM, 8, ksayakyu_state )
AM_RANGE(0xa001, 0xa001) AM_DEVREAD("ay1", ay8910_device, data_r)
AM_RANGE(0xa002, 0xa003) AM_DEVWRITE("ay1", ay8910_device, data_address_w)
AM_RANGE(0xa006, 0xa007) AM_DEVWRITE("ay2", ay8910_device, data_address_w)
- AM_RANGE(0xa008, 0xa008) AM_DEVWRITE("dac", dac_device, write_unsigned8)
+ AM_RANGE(0xa008, 0xa008) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(0xa00c, 0xa00c) AM_WRITE(tomaincpu_w)
AM_RANGE(0xa010, 0xa010) AM_WRITENOP //a timer of some sort?
ADDRESS_MAP_END
@@ -274,22 +275,23 @@ static MACHINE_CONFIG_START( ksayakyu, ksayakyu_state )
MCFG_PALETTE_INIT_OWNER(ksayakyu_state, ksayakyu)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("ay1", AY8910, MAIN_CLOCK/16) //unknown clock
MCFG_AY8910_PORT_A_READ_CB(DEVREAD8("soundlatch", generic_latch_8_device, read))
MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(ksayakyu_state, dummy1_w))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
MCFG_SOUND_ADD("ay2", AY8910, MAIN_CLOCK/16) //unknown clock
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(ksayakyu_state, dummy2_w))
MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(ksayakyu_state, dummy3_w))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
+ MCFG_SOUND_ADD("dac", DAC_6BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
ROM_START( ksayakyu )
diff --git a/src/mame/drivers/laserbat.cpp b/src/mame/drivers/laserbat.cpp
index 946d22200c8..fcb7a3df640 100644
--- a/src/mame/drivers/laserbat.cpp
+++ b/src/mame/drivers/laserbat.cpp
@@ -504,7 +504,7 @@ static MACHINE_CONFIG_DERIVED_CLASS( laserbat, laserbat_base, laserbat_state )
MCFG_PALETTE_INIT_OWNER(laserbat_state, laserbat)
// sound board devices
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_SOUND_ADD("csg", SN76477, 0) // audio output not used
MCFG_SN76477_NOISE_PARAMS(RES_K(47), RES_K(270), CAP_P(1000)) // R21, switchable R30/R23/R24/R25/R29/R28/R27/R26, C21
@@ -522,10 +522,10 @@ static MACHINE_CONFIG_DERIVED_CLASS( laserbat, laserbat_base, laserbat_state )
MCFG_SN76477_ENABLE(0) // AB SOUND
MCFG_TMS3615_ADD("synth_low", XTAL_4MHz/16/2) // from the other one's /2 clock output
- MCFG_SOUND_ROUTE(TMS3615_FOOTAGE_8, "mono", 1.0)
+ MCFG_SOUND_ROUTE(TMS3615_FOOTAGE_8, "speaker", 1.0)
MCFG_TMS3615_ADD("synth_high", XTAL_4MHz/16) // 4MHz divided down with a 74LS161
- MCFG_SOUND_ROUTE(TMS3615_FOOTAGE_8, "mono", 1.0)
+ MCFG_SOUND_ROUTE(TMS3615_FOOTAGE_8, "speaker", 1.0)
MACHINE_CONFIG_END
@@ -536,9 +536,9 @@ static MACHINE_CONFIG_DERIVED_CLASS( catnmous, laserbat_base, catnmous_state )
MCFG_PALETTE_INIT_OWNER(catnmous_state, catnmous)
// sound board devices
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_ZACCARIA_1B11107("audiopcb")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("audiopcb", ZACCARIA_1B11107, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/lasso.cpp b/src/mame/drivers/lasso.cpp
index 3451fe1d5bd..935a0bc6cc8 100644
--- a/src/mame/drivers/lasso.cpp
+++ b/src/mame/drivers/lasso.cpp
@@ -31,11 +31,12 @@ DIP locations verified for:
***************************************************************************/
#include "emu.h"
+#include "includes/lasso.h"
#include "cpu/m6502/m6502.h"
#include "cpu/z80/z80.h"
-#include "sound/dac.h"
#include "sound/ay8910.h"
-#include "includes/lasso.h"
+#include "sound/dac.h"
+#include "sound/volt_reg.h"
INPUT_CHANGED_MEMBER(lasso_state::coin_inserted)
@@ -160,7 +161,7 @@ static ADDRESS_MAP_START( wwjgtin_audio_map, AS_PROGRAM, 8, lasso_state )
AM_RANGE(0x4000, 0x7fff) AM_MIRROR(0x8000) AM_ROM
AM_RANGE(0xb000, 0xb000) AM_WRITEONLY AM_SHARE("chip_data")
AM_RANGE(0xb001, 0xb001) AM_WRITE(sound_select_w)
- AM_RANGE(0xb003, 0xb003) AM_DEVWRITE("dac", dac_device, write_unsigned8)
+ AM_RANGE(0xb003, 0xb003) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(0xb004, 0xb004) AM_READ(sound_status_r)
AM_RANGE(0xb005, 0xb005) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
ADDRESS_MAP_END
@@ -501,15 +502,15 @@ static MACHINE_CONFIG_START( base, lasso_state )
MCFG_GFXDECODE_ADD("gfxdecode", "palette", lasso)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("sn76489.1", SN76489, 2000000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MCFG_SOUND_ADD("sn76489.2", SN76489, 2000000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( lasso, base )
@@ -563,8 +564,9 @@ static MACHINE_CONFIG_DERIVED( wwjgtin, base )
MCFG_VIDEO_START_OVERRIDE(lasso_state,wwjgtin)
/* sound hardware */
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( pinbo, base )
@@ -591,10 +593,10 @@ static MACHINE_CONFIG_DERIVED( pinbo, base )
MCFG_DEVICE_REMOVE("sn76489.2")
MCFG_SOUND_ADD("ay1", AY8910, XTAL_18MHz/12)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.55)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.55)
MCFG_SOUND_ADD("ay2", AY8910, XTAL_18MHz/12)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.55)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.55)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/lazercmd.cpp b/src/mame/drivers/lazercmd.cpp
index f78dd9488cd..df7f7d26933 100644
--- a/src/mame/drivers/lazercmd.cpp
+++ b/src/mame/drivers/lazercmd.cpp
@@ -235,6 +235,7 @@
#include "emu.h"
#include "includes/lazercmd.h"
+#include "sound/volt_reg.h"
// color overlays, bbonk does not have an overlay
#include "lazercmd.lh"
@@ -309,11 +310,10 @@ WRITE8_MEMBER(lazercmd_state::lazercmd_hardware_w)
switch (offset)
{
case 0: /* audio channels */
- m_dac_data = (data & 0x80) ^ ((data & 0x40) << 1) ^ ((data & 0x20) << 2) ^ ((data & 0x10) << 3);
- if (m_dac_data)
- m_dac->write_unsigned8(0xff);
- else
- m_dac->write_unsigned8(0);
+ m_dac0->write(BIT(data, 7));
+ m_dac1->write(BIT(data, 6));
+ m_dac2->write(BIT(data, 5));
+ m_dac3->write(BIT(data, 4));
break;
case 1: /* marker Y position */
m_marker_y = data;
@@ -335,11 +335,8 @@ WRITE8_MEMBER(lazercmd_state::medlanes_hardware_w)
/* bits 4 and 5 are used to control a sound board */
/* these could be used to control sound samples */
/* at the moment they are routed through the dac */
- m_dac_data = ((data & 0x20) << 2) ^ ((data & 0x10) << 3);
- if (m_dac_data)
- m_dac->write_unsigned8(0xff);
- else
- m_dac->write_unsigned8(0);
+ m_dac2->write(BIT(data, 5));
+ m_dac3->write(BIT(data, 4));
break;
case 1: /* marker Y position */
m_marker_y = data;
@@ -361,11 +358,8 @@ WRITE8_MEMBER(lazercmd_state::bbonk_hardware_w)
/* bits 4 and 5 are used to control a sound board */
/* these could be used to control sound samples */
/* at the moment they are routed through the dac */
- m_dac_data = ((data & 0x20) << 2) ^ ((data & 0x10) << 3);
- if (m_dac_data)
- m_dac->write_unsigned8(0xff);
- else
- m_dac->write_unsigned8(0);
+ m_dac2->write(BIT(data, 5));
+ m_dac3->write(BIT(data, 4));
break;
case 3: /* D5 inverts video?, D4 clears coin detected and D0 toggles on attract mode */
m_attract = data;
@@ -613,7 +607,6 @@ void lazercmd_state::machine_start()
save_item(NAME(m_marker_y));
save_item(NAME(m_timer_count));
save_item(NAME(m_sense_state));
- save_item(NAME(m_dac_data));
save_item(NAME(m_attract));
}
@@ -623,7 +616,6 @@ void lazercmd_state::machine_reset()
m_marker_y = 0;
m_timer_count = 0;
m_sense_state = 0;
- m_dac_data = 0;
m_attract = 0;
}
@@ -654,10 +646,16 @@ static MACHINE_CONFIG_START( lazercmd, lazercmd_state )
MCFG_PALETTE_INIT_OWNER(lazercmd_state, lazercmd)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
-
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac0", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.99)
+ MCFG_SOUND_ADD("dac1", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.99)
+ MCFG_SOUND_ADD("dac2", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.99)
+ MCFG_SOUND_ADD("dac3", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.99)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac0", 1.0, DAC_VREF_POS_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac1", 1.0, DAC_VREF_POS_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac2", 1.0, DAC_VREF_POS_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac3", 1.0, DAC_VREF_POS_INPUT)
MACHINE_CONFIG_END
@@ -687,10 +685,12 @@ static MACHINE_CONFIG_START( medlanes, lazercmd_state )
MCFG_PALETTE_INIT_OWNER(lazercmd_state, lazercmd)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
-
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac2", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.99)
+ MCFG_SOUND_ADD("dac3", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.99)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac2", 1.0, DAC_VREF_POS_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac3", 1.0, DAC_VREF_POS_INPUT)
MACHINE_CONFIG_END
@@ -720,10 +720,12 @@ static MACHINE_CONFIG_START( bbonk, lazercmd_state )
MCFG_PALETTE_INIT_OWNER(lazercmd_state, lazercmd)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
-
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac2", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.99)
+ MCFG_SOUND_ADD("dac3", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.99)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac2", 1.0, DAC_VREF_POS_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac3", 1.0, DAC_VREF_POS_INPUT)
MACHINE_CONFIG_END
/***************************************************************************
diff --git a/src/mame/drivers/leland.cpp b/src/mame/drivers/leland.cpp
index aa59e32d783..51b5a0d0384 100644
--- a/src/mame/drivers/leland.cpp
+++ b/src/mame/drivers/leland.cpp
@@ -59,12 +59,12 @@
***************************************************************************/
#include "emu.h"
+#include "includes/leland.h"
#include "cpu/i86/i186.h"
+#include "cpu/z80/z80.h"
#include "machine/eepromser.h"
#include "machine/nvram.h"
-#include "cpu/z80/z80.h"
-#include "includes/leland.h"
-#include "sound/ay8910.h"
+#include "sound/volt_reg.h"
/* Master Clock2 is for Asylum, Ataxx, Brute Force, Danny Sullivan's Indy Heat, World Soccer Finals */
@@ -935,26 +935,6 @@ INPUT_PORTS_END
/*************************************
*
- * Sound definitions
- *
- *************************************/
-
-/*
- 2 AY8910 chips - Actually, one of these is an 8912
- (8910 with only 1 output port)
-
- Port A of both chips is connected to a banking control
- register.
-
- All 6 (3*2) AY-3-8910/12 outputs are tied together
- and put with 1000 Ohm to gnd.
- The following is a approximation, since
- it does not take cross-chip mixing effects into account.
-*/
-
-
-/*************************************
- *
* Machine driver
*
*************************************/
@@ -980,26 +960,28 @@ static MACHINE_CONFIG_START( leland, leland_state )
/* video hardware */
MCFG_FRAGMENT_ADD(leland_video)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
- MCFG_SOUND_ADD("ay8910.1", AY8910, 10000000/6)
+ // only one of the AY sockets is populated
+ MCFG_SOUND_ADD("ay8910", AY8910, 10000000/6)
MCFG_AY8910_OUTPUT_TYPE(AY8910_SINGLE_OUTPUT)
MCFG_AY8910_RES_LOADS(1000, 0, 0)
MCFG_AY8910_PORT_A_READ_CB(READ8(leland_state, leland_sound_port_r))
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(leland_state, leland_sound_port_w))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
-
- MCFG_SOUND_ADD("ay8910.2", AY8910, 10000000/6)
- MCFG_AY8910_OUTPUT_TYPE(AY8910_SINGLE_OUTPUT)
- MCFG_AY8910_RES_LOADS(1000, 0, 0)
- MCFG_AY8910_PORT_A_READ_CB(READ8(leland_state, leland_sound_port_r))
- MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(leland_state, leland_sound_port_w))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
-
- MCFG_SOUND_ADD("dac0", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
- MCFG_SOUND_ADD("dac1", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
+
+// MCFG_SOUND_ADD("ay8912", AY8912, 10000000/6)
+// MCFG_AY8910_OUTPUT_TYPE(AY8910_SINGLE_OUTPUT)
+// MCFG_AY8910_RES_LOADS(1000, 0, 0)
+// MCFG_AY8910_PORT_A_READ_CB(READ8(leland_state, leland_sound_port_r))
+// MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(leland_state, leland_sound_port_w))
+// MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
+
+ MCFG_SOUND_ADD("dac0", DAC_8BIT_BINARY_WEIGHTED, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.0625) // ls374.u79 + r17-r23 (24k,12k,6.2k,3k,1.5k,750,390,180)
+ MCFG_SOUND_ADD("dac1", DAC_8BIT_BINARY_WEIGHTED, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.0625) // ls374.u88 + r27-r34 (24k,12k,6.2k,3k,1.5k,750,390,180)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac0", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac0", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac1", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac1", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/littlerb.cpp b/src/mame/drivers/littlerb.cpp
index a57effa73f6..122f7f0f889 100644
--- a/src/mame/drivers/littlerb.cpp
+++ b/src/mame/drivers/littlerb.cpp
@@ -68,8 +68,9 @@ Dip sw.2
#include "emu.h"
#include "cpu/m68000/m68000.h"
-#include "sound/dac.h"
#include "machine/inder_vid.h"
+#include "sound/dac.h"
+#include "sound/volt_reg.h"
class littlerb_state : public driver_device
{
@@ -78,21 +79,17 @@ public:
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_indervid(*this, "inder_vid"),
- m_dacl(*this, "dacl"),
- m_dacr(*this, "dacr"),
+ m_ldac(*this, "ldac"),
+ m_rdac(*this, "rdac"),
m_soundframe(0)
{
}
-
-
-
required_device<cpu_device> m_maincpu;
required_device<inder_vid_device> m_indervid;
-
- required_device<dac_device> m_dacl;
- required_device<dac_device> m_dacr;
+ required_device<dac_byte_interface> m_ldac;
+ required_device<dac_byte_interface> m_rdac;
UINT8 m_sound_index_l,m_sound_index_r;
UINT16 m_sound_pointer_l,m_sound_pointer_r;
int m_soundframe;
@@ -235,13 +232,10 @@ INPUT_PORTS_END
TIMER_DEVICE_CALLBACK_MEMBER(littlerb_state::littlerb_sound_cb)
{
- UINT8 res;
UINT8 *sample_rom = memregion("samples")->base();
- res = sample_rom[m_sound_pointer_l|(m_sound_index_l<<10)|0x40000];
- m_dacl->write_signed8(res);
- res = sample_rom[m_sound_pointer_r|(m_sound_index_r<<10)|0x00000];
- m_dacr->write_signed8(res);
+ m_ldac->write(sample_rom[m_sound_pointer_l | (m_sound_index_l << 10) | 0x40000]);
+ m_rdac->write(sample_rom[m_sound_pointer_r | (m_sound_index_r << 10) | 0x00000]);
m_sound_pointer_l++;
m_sound_pointer_l&=0x3ff;
m_sound_pointer_r++;
@@ -265,11 +259,11 @@ static MACHINE_CONFIG_START( littlerb, littlerb_state )
MCFG_SPEAKER_STANDARD_STEREO("lspeaker","rspeaker")
- MCFG_DAC_ADD("dacl")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.50)
-
- MCFG_DAC_ADD("dacr")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.50)
+ MCFG_SOUND_ADD("ldac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.5) // unknown DAC
+ MCFG_SOUND_ADD("rdac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.5) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "ldac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "ldac", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "rdac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "rdac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
ROM_START( littlerb )
diff --git a/src/mame/drivers/looping.cpp b/src/mame/drivers/looping.cpp
index e6e2f558c82..e7c6a4691b9 100644
--- a/src/mame/drivers/looping.cpp
+++ b/src/mame/drivers/looping.cpp
@@ -55,6 +55,7 @@ L056-6 9A " " VLI-8-4 7A "
*/
#include "emu.h"
+#include "cpu/cop400/cop400.h"
#include "cpu/tms9900/tms9995.h"
#include "cpu/tms9900/tms9980a.h"
#include "machine/gen_latch.h"
@@ -62,8 +63,8 @@ L056-6 9A " " VLI-8-4 7A "
#include "sound/ay8910.h"
#include "sound/dac.h"
#include "sound/tms5220.h"
+#include "sound/volt_reg.h"
#include "video/resnet.h"
-#include "cpu/cop400/cop400.h"
/*************************************
@@ -161,7 +162,7 @@ public:
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
- required_device<dac_device> m_dac;
+ required_device<dac_byte_interface> m_dac;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
required_device<generic_latch_8_device> m_soundlatch;
@@ -419,7 +420,7 @@ WRITE8_MEMBER(looping_state::looping_sound_sw)
*/
m_sound[offset + 1] = data ^ 1;
- m_dac->write_unsigned8(((m_sound[2] << 7) + (m_sound[3] << 6)) * m_sound[7]);
+ m_dac->write(((m_sound[2] << 1) + m_sound[3]) * m_sound[7]);
}
@@ -649,20 +650,21 @@ static MACHINE_CONFIG_START( looping, looping_state )
MCFG_PALETTE_INIT_OWNER(looping_state, looping)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("aysnd", AY8910, SOUND_CLOCK/4)
MCFG_AY8910_PORT_A_READ_CB(DEVREAD8("soundlatch", generic_latch_8_device, read))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.2)
MCFG_SOUND_ADD("tms", TMS5220, TMS_CLOCK)
MCFG_TMS52XX_IRQ_HANDLER(WRITELINE(looping_state, looping_spcint))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
+ MCFG_SOUND_ADD("dac", DAC_2BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.15) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/m72.cpp b/src/mame/drivers/m72.cpp
index 0280a91cc60..98cefc79b33 100644
--- a/src/mame/drivers/m72.cpp
+++ b/src/mame/drivers/m72.cpp
@@ -184,14 +184,15 @@ other supported games as well.
***************************************************************************/
#include "emu.h"
-#include "cpu/z80/z80.h"
+#include "includes/m72.h"
+#include "includes/iremipt.h"
+#include "cpu/mcs51/mcs51.h"
#include "cpu/nec/nec.h"
#include "cpu/nec/v25.h"
+#include "cpu/z80/z80.h"
#include "machine/irem_cpu.h"
#include "sound/ym2151.h"
-#include "includes/iremipt.h"
-#include "includes/m72.h"
-#include "cpu/mcs51/mcs51.h"
+#include "sound/volt_reg.h"
#define MASTER_CLOCK XTAL_32MHz
#define SOUND_CLOCK XTAL_3_579545MHz
@@ -480,7 +481,7 @@ DRIVER_INIT_MEMBER(m72_state,m72_8751)
io.install_write_handler(0xc0, 0xc1, write16_delegate(FUNC(m72_state::main_mcu_sound_w),this));
/* sound cpu */
- sndio.install_write_handler(0x82, 0x82, write8_delegate(FUNC(dac_device::write_unsigned8),(dac_device*)m_dac));
+ sndio.install_write_handler(0x82, 0x82, write8_delegate(FUNC(dac_byte_interface::write),(dac_byte_interface *)m_dac));
sndio.install_read_handler (0x84, 0x84, read8_delegate(FUNC(m72_state::snd_cpu_sample_r),this));
/* lohtb2 */
@@ -1869,18 +1870,19 @@ GFXDECODE_END
static MACHINE_CONFIG_FRAGMENT( m72_audio_chips )
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_SOUND_ADD("m72", M72, 0);
+ MCFG_SOUND_ADD("m72", M72, 0)
MCFG_YM2151_ADD("ymsnd", SOUND_CLOCK)
MCFG_YM2151_IRQ_HANDLER(DEVWRITELINE("m72", m72_audio_device, ym2151_irq_handler))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.2) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( m72_base, m72_state )
@@ -1923,7 +1925,6 @@ static MACHINE_CONFIG_DERIVED( m72_8751, m72_base )
MCFG_CPU_ADD("mcu",I8751, XTAL_8MHz) /* Uses its own XTAL */
MCFG_CPU_IO_MAP(mcu_io_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", m72_state, mcu_int)
-
MACHINE_CONFIG_END
@@ -1935,6 +1936,7 @@ static MACHINE_CONFIG_DERIVED( rtype, m72_base )
MCFG_CPU_IO_MAP(rtype_sound_portmap)
MCFG_DEVICE_REMOVE("dac")
+ MCFG_DEVICE_REMOVE("vref")
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( m72_xmultipl, m72_8751 )
diff --git a/src/mame/drivers/m90.cpp b/src/mame/drivers/m90.cpp
index 766cd377685..6658e5c0e53 100644
--- a/src/mame/drivers/m90.cpp
+++ b/src/mame/drivers/m90.cpp
@@ -19,14 +19,15 @@
*****************************************************************************/
#include "emu.h"
-#include "cpu/z80/z80.h"
+#include "includes/m90.h"
+#include "includes/iremipt.h"
#include "cpu/nec/nec.h"
#include "cpu/nec/v25.h"
-#include "includes/iremipt.h"
+#include "cpu/z80/z80.h"
#include "machine/irem_cpu.h"
#include "sound/dac.h"
#include "sound/ym2151.h"
-#include "includes/m90.h"
+#include "sound/volt_reg.h"
/***************************************************************************/
@@ -142,7 +143,7 @@ static ADDRESS_MAP_START( dynablsb_sound_cpu_io_map, AS_IO, 8, m90_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x01) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
AM_RANGE(0x80, 0x80) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
- AM_RANGE(0x82, 0x82) AM_DEVWRITE("dac", dac_device, write_signed8)
+ AM_RANGE(0x82, 0x82) AM_DEVWRITE("dac", dac_byte_interface, write)
ADDRESS_MAP_END
static ADDRESS_MAP_START( m99_sound_cpu_io_map, AS_IO, 8, m90_state )
@@ -742,7 +743,7 @@ static MACHINE_CONFIG_START( m90, m90_state )
MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
@@ -750,11 +751,12 @@ static MACHINE_CONFIG_START( m90, m90_state )
MCFG_YM2151_ADD("ymsnd", XTAL_3_579545MHz) /* verified on pcb */
MCFG_YM2151_IRQ_HANDLER(DEVWRITELINE("m72", m72_audio_device, ym2151_irq_handler))
- MCFG_SOUND_ROUTE(0, "mono", 0.15)
- MCFG_SOUND_ROUTE(1, "mono", 0.15)
+ MCFG_SOUND_ROUTE(0, "speaker", 0.15)
+ MCFG_SOUND_ROUTE(1, "speaker", 0.15)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.1) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/mac.cpp b/src/mame/drivers/mac.cpp
index 321d8208dea..4b88606d1f9 100644
--- a/src/mame/drivers/mac.cpp
+++ b/src/mame/drivers/mac.cpp
@@ -46,21 +46,18 @@
#include "emu.h"
+#include "includes/mac.h"
#include "cpu/m68000/m68000.h"
#include "cpu/powerpc/ppc.h"
#include "cpu/m6805/m6805.h"
-#include "machine/6522via.h"
#include "machine/applefdc.h"
#include "machine/swim.h"
#include "machine/sonydriv.h"
#include "formats/ap_dsk35.h"
-#include "machine/ram.h"
#include "bus/scsi/scsi.h"
#include "bus/scsi/scsihd.h"
#include "bus/scsi/scsicd.h"
-#include "sound/asc.h"
-#include "sound/awacs.h"
-#include "sound/cdda.h"
+#include "sound/volt_reg.h"
// NuBus and 030/040 PDS cards
#include "bus/nubus/nubus_48gc.h"
@@ -83,7 +80,6 @@
// 68000 PDS cards
#include "bus/macpds/pds_tpdfpd.h"
-#include "includes/mac.h"
#include "machine/macadb.h"
#include "softlist.h"
#include "mac.lh"
@@ -574,31 +570,17 @@ TIMER_DEVICE_CALLBACK_MEMBER(mac_state::mac_scanline)
{
int scanline = param;
UINT16 *mac_snd_buf_ptr;
- UINT16 last_val;
- if (m_snd_enable)
+ if (m_main_buffer)
{
- if (m_main_buffer)
- {
- mac_snd_buf_ptr = (UINT16 *)(m_ram->pointer() + m_ram->size() - MAC_MAIN_SND_BUF_OFFSET);
- }
- else
- {
- mac_snd_buf_ptr = (UINT16 *)(m_ram->pointer() + m_ram->size() - MAC_ALT_SND_BUF_OFFSET);
- }
-
- last_val = (UINT8)((mac_snd_buf_ptr[scanline] >> 8) & 0xff);
+ mac_snd_buf_ptr = (UINT16 *)(m_ram->pointer() + m_ram->size() - MAC_MAIN_SND_BUF_OFFSET);
}
else
{
- last_val = 0x80;
+ mac_snd_buf_ptr = (UINT16 *)(m_ram->pointer() + m_ram->size() - MAC_ALT_SND_BUF_OFFSET);
}
- // apply 0-7 volume
- last_val *= m_snd_vol;
- last_val <<= 5;
-
- m_dac->write_unsigned16(last_val);
+ m_dac->write(mac_snd_buf_ptr[scanline] >> 8);
}
@@ -945,10 +927,10 @@ static MACHINE_CONFIG_START( mac512ke, mac_state )
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", mac_state, mac_scanline, "screen", 0, 1)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
- //MCFG_SOUND_ADD("custom", MAC_SOUND, 0)
- MCFG_SOUND_ADD(DAC_TAG, DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_8BIT_PWM, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) // 2 x ls161
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
/* devices */
MCFG_RTC3430042_ADD("rtc", XTAL_32_768kHz)
diff --git a/src/mame/drivers/magicfly.cpp b/src/mame/drivers/magicfly.cpp
index a447a05781c..479574b3d90 100644
--- a/src/mame/drivers/magicfly.cpp
+++ b/src/mame/drivers/magicfly.cpp
@@ -445,9 +445,10 @@
#include "emu.h"
#include "cpu/m6502/m6502.h"
-#include "video/mc6845.h"
-#include "sound/dac.h"
#include "machine/nvram.h"
+#include "sound/dac.h"
+#include "sound/volt_reg.h"
+#include "video/mc6845.h"
class magicfly_state : public driver_device
@@ -477,7 +478,7 @@ public:
DECLARE_VIDEO_START(7mezzo);
UINT32 screen_update_magicfly(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
required_device<cpu_device> m_maincpu;
- required_device<dac_device> m_dac;
+ required_device<dac_bit_interface> m_dac;
required_device<gfxdecode_device> m_gfxdecode;
};
@@ -658,7 +659,7 @@ WRITE8_MEMBER(magicfly_state::mux_port_w)
*/
m_input_selector = data & 0x0f; /* Input Selector */
- m_dac->write_unsigned8(data & 0x80); /* Sound DAC */
+ m_dac->write(BIT(data, 7)); /* Sound DAC */
machine().bookkeeping().coin_counter_w(0, data & 0x40); /* Coin1 */
machine().bookkeeping().coin_counter_w(1, data & 0x10); /* Coin2 */
@@ -956,10 +957,10 @@ static MACHINE_CONFIG_START( magicfly, magicfly_state )
MCFG_MC6845_CHAR_WIDTH(8)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
-
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/mappy.cpp b/src/mame/drivers/mappy.cpp
index 784d951bca5..92c8cc959c8 100644
--- a/src/mame/drivers/mappy.cpp
+++ b/src/mame/drivers/mappy.cpp
@@ -549,10 +549,10 @@ TODO:
***************************************************************************/
#include "emu.h"
+#include "includes/mappy.h"
#include "cpu/m6809/m6809.h"
#include "machine/watchdog.h"
-#include "sound/dac.h"
-#include "includes/mappy.h"
+#include "sound/volt_reg.h"
/*************************************
*
@@ -1696,11 +1696,11 @@ static MACHINE_CONFIG_FRAGMENT( superpac_common )
MCFG_VIDEO_START_OVERRIDE(mappy_state,superpac)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_SOUND_ADD("namco", NAMCO_15XX, 18432000/768)
MCFG_NAMCO_AUDIO_VOICES(8)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
@@ -1766,8 +1766,9 @@ static MACHINE_CONFIG_START( grobda, mappy_state )
MCFG_NAMCO56XX_OUT_0_CB(WRITE8(mappy_state, out_mux))
/* sound hardware */
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.55)
+ MCFG_SOUND_ADD("dac", DAC_4BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.275) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
@@ -1820,11 +1821,11 @@ static MACHINE_CONFIG_START( phozon, mappy_state )
MCFG_VIDEO_START_OVERRIDE(mappy_state,phozon)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_SOUND_ADD("namco", NAMCO_15XX, 18432000/768)
MCFG_NAMCO_AUDIO_VOICES(8)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
@@ -1860,11 +1861,11 @@ static MACHINE_CONFIG_FRAGMENT( mappy_common )
MCFG_VIDEO_START_OVERRIDE(mappy_state,mappy)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_SOUND_ADD("namco", NAMCO_15XX, 18432000/768)
MCFG_NAMCO_AUDIO_VOICES(8)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( mappy, mappy_state )
@@ -2397,11 +2398,6 @@ ROM_END
-WRITE8_MEMBER(mappy_state::grobda_DAC_w)
-{
- m_dac->write_unsigned8((data << 4) | data);
-}
-
DRIVER_INIT_MEMBER(mappy_state,superpac)
{
m_type = GAME_SUPERPAC;
@@ -2424,7 +2420,7 @@ DRIVER_INIT_MEMBER(mappy_state,grobda)
However, removing the 15XX from the board causes sound to disappear completely, so
the DAC might be built-in after all.
*/
- m_subcpu->space(AS_PROGRAM).install_write_handler(0x0002, 0x0002, write8_delegate(FUNC(mappy_state::grobda_DAC_w),this));
+ m_subcpu->space(AS_PROGRAM).install_write_handler(0x0002, 0x0002, write8_delegate(FUNC(dac_byte_interface::write), (dac_byte_interface *)m_dac));
}
DRIVER_INIT_MEMBER(mappy_state,phozon)
diff --git a/src/mame/drivers/matmania.cpp b/src/mame/drivers/matmania.cpp
index 4b872c5a373..305c364f3b8 100644
--- a/src/mame/drivers/matmania.cpp
+++ b/src/mame/drivers/matmania.cpp
@@ -32,14 +32,14 @@ The driver has been updated accordingly.
***************************************************************************/
#include "emu.h"
+#include "includes/matmania.h"
#include "cpu/m6502/m6502.h"
#include "cpu/m6809/m6809.h"
#include "cpu/m6805/m6805.h"
+#include "sound/3526intf.h"
#include "sound/ay8910.h"
#include "sound/dac.h"
-#include "sound/3526intf.h"
-#include "includes/matmania.h"
-
+#include "sound/volt_reg.h"
/*************************************
*
@@ -230,7 +230,7 @@ static ADDRESS_MAP_START( matmania_sound_map, AS_PROGRAM, 8, matmania_state )
AM_RANGE(0x0000, 0x01ff) AM_RAM
AM_RANGE(0x2000, 0x2001) AM_DEVWRITE("ay1", ay8910_device, data_address_w)
AM_RANGE(0x2002, 0x2003) AM_DEVWRITE("ay2", ay8910_device, data_address_w)
- AM_RANGE(0x2004, 0x2004) AM_DEVWRITE("dac", dac_device, write_signed8)
+ AM_RANGE(0x2004, 0x2004) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(0x2007, 0x2007) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE(0x8000, 0xffff) AM_ROM
ADDRESS_MAP_END
@@ -238,7 +238,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( maniach_sound_map, AS_PROGRAM, 8, matmania_state )
AM_RANGE(0x0000, 0x0fff) AM_RAM
AM_RANGE(0x2000, 0x2001) AM_DEVWRITE("ymsnd", ym3526_device, write)
- AM_RANGE(0x2002, 0x2002) AM_DEVWRITE("dac", dac_device, write_signed8)
+ AM_RANGE(0x2002, 0x2002) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(0x2004, 0x2004) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE(0x4000, 0xffff) AM_ROM
ADDRESS_MAP_END
@@ -449,18 +449,19 @@ static MACHINE_CONFIG_START( matmania, matmania_state )
MCFG_PALETTE_INIT_OWNER(matmania_state, matmania)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("ay1", AY8910, 1500000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.3)
MCFG_SOUND_ADD("ay2", AY8910, 1500000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.3)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.4) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
@@ -530,16 +531,17 @@ static MACHINE_CONFIG_START( maniach, matmania_state )
MCFG_PALETTE_INIT_OWNER(matmania_state, matmania)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("ymsnd", YM3526, 3600000)
MCFG_YM3526_IRQ_HANDLER(INPUTLINE("audiocpu", M6809_FIRQ_LINE))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.4) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/mc10.cpp b/src/mame/drivers/mc10.cpp
index 5451c6ea12e..1817a096725 100644
--- a/src/mame/drivers/mc10.cpp
+++ b/src/mame/drivers/mc10.cpp
@@ -9,13 +9,14 @@
#include "emu.h"
#include "cpu/m6800/m6800.h"
-#include "sound/dac.h"
-#include "video/mc6847.h"
-#include "video/ef9345.h"
+#include "formats/coco_cas.h"
#include "imagedev/cassette.h"
#include "imagedev/printer.h"
-#include "formats/coco_cas.h"
#include "machine/ram.h"
+#include "sound/dac.h"
+#include "sound/volt_reg.h"
+#include "video/mc6847.h"
+#include "video/ef9345.h"
#include "softlist.h"
//printer state
@@ -48,7 +49,7 @@ public:
required_device<m6803_cpu_device> m_maincpu;
optional_device<mc6847_base_device> m_mc6847;
optional_device<ef9345_device> m_ef9345;
- required_device<dac_device> m_dac;
+ required_device<dac_bit_interface> m_dac;
required_device<ram_device> m_ram;
required_device<cassette_image_device> m_cassette;
required_device<printer_image_device> m_printer;
@@ -131,13 +132,13 @@ WRITE8_MEMBER( mc10_state::mc10_bfff_w )
m_mc6847->css_w(BIT(data, 6));
/* bit 7, dac output */
- m_dac->write_unsigned8(BIT(data, 7));
+ m_dac->write(BIT(data, 7));
}
WRITE8_MEMBER( mc10_state::alice32_bfff_w )
{
/* bit 7, dac output */
- m_dac->write_unsigned8(BIT(data, 7));
+ m_dac->write(BIT(data, 7));
}
@@ -490,9 +491,10 @@ static MACHINE_CONFIG_START( mc10, mc10_state )
MCFG_MC6847_INPUT_CALLBACK(READ8(mc10_state, mc6847_videoram_r))
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("dac", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.0625)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT)
MCFG_CASSETTE_ADD("cassette")
MCFG_CASSETTE_FORMATS(coco_cassette_formats)
@@ -531,9 +533,10 @@ static MACHINE_CONFIG_START( alice32, mc10_state )
MCFG_TIMER_DRIVER_ADD_SCANLINE("alice32_sl", mc10_state, alice32_scanline, "screen", 0, 10)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("dac", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.0625)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT)
MCFG_CASSETTE_ADD("cassette")
MCFG_CASSETTE_FORMATS(alice32_cassette_formats)
diff --git a/src/mame/drivers/mcr.cpp b/src/mame/drivers/mcr.cpp
index f95392d9bc3..fb8fb961d09 100644
--- a/src/mame/drivers/mcr.cpp
+++ b/src/mame/drivers/mcr.cpp
@@ -1791,7 +1791,7 @@ static MACHINE_CONFIG_START( mcr_90009, mcr_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
- MCFG_MIDWAY_SSIO_ADD("ssio")
+ MCFG_SOUND_ADD("ssio", MIDWAY_SSIO, 0)
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
MACHINE_CONFIG_END
@@ -1868,7 +1868,7 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( mcr_91490_snt, mcr_91490 )
/* basic machine hardware */
- MCFG_MIDWAY_SQUAWK_N_TALK_ADD("snt")
+ MCFG_SOUND_ADD("snt", MIDWAY_SQUAWK_N_TALK, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
MACHINE_CONFIG_END
@@ -1907,7 +1907,7 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( mcr_91490_tcs, mcr_91490 )
/* basic machine hardware */
- MCFG_MIDWAY_TURBO_CHIP_SQUEAK_ADD("tcs")
+ MCFG_SOUND_ADD("tcs", MIDWAY_TURBO_CHIP_SQUEAK, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/mcr3.cpp b/src/mame/drivers/mcr3.cpp
index f0c4804d4f6..0dda83ab1b3 100644
--- a/src/mame/drivers/mcr3.cpp
+++ b/src/mame/drivers/mcr3.cpp
@@ -1126,7 +1126,7 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( mono_tcs, mcrmono )
/* basic machine hardware */
- MCFG_MIDWAY_TURBO_CHIP_SQUEAK_ADD("tcs")
+ MCFG_SOUND_ADD("tcs", MIDWAY_TURBO_CHIP_SQUEAK, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
MACHINE_CONFIG_END
@@ -1136,7 +1136,7 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( mono_sg, mcrmono )
/* basic machine hardware */
- MCFG_MIDWAY_SOUNDS_GOOD_ADD("sg")
+ MCFG_SOUND_ADD("sg", MIDWAY_SOUNDS_GOOD, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
MACHINE_CONFIG_END
@@ -1149,7 +1149,7 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( mcrscroll, mcrmono )
/* basic machine hardware */
- MCFG_MIDWAY_SSIO_ADD("ssio")
+ MCFG_SOUND_ADD("ssio", MIDWAY_SSIO, 0)
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
@@ -1175,7 +1175,7 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( mcrsc_csd, mcrscroll )
/* basic machine hardware */
- MCFG_MIDWAY_CHIP_SQUEAK_DELUXE_ADD("csd")
+ MCFG_SOUND_ADD("csd", MIDWAY_CHIP_SQUEAK_DELUXE, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/mcr68.cpp b/src/mame/drivers/mcr68.cpp
index ede36d0e4f2..5b14fffa3ea 100644
--- a/src/mame/drivers/mcr68.cpp
+++ b/src/mame/drivers/mcr68.cpp
@@ -1059,9 +1059,9 @@ static MACHINE_CONFIG_START( zwackery, mcr68_state )
MCFG_VIDEO_START_OVERRIDE(mcr68_state,zwackery)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_MIDWAY_CHIP_SQUEAK_DELUXE_ADD("csd")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("csd", MIDWAY_CHIP_SQUEAK_DELUXE, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
@@ -1093,22 +1093,22 @@ static MACHINE_CONFIG_START( mcr68, mcr68_state )
MCFG_VIDEO_START_OVERRIDE(mcr68_state,mcr68)
/* sound hardware -- determined by specific machine */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( xenophob, mcr68 )
/* basic machine hardware */
- MCFG_MIDWAY_SOUNDS_GOOD_ADD("sg")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ADD("sg", MIDWAY_SOUNDS_GOOD, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( intlaser, mcr68 )
/* basic machine hardware */
- MCFG_MIDWAY_SOUNDS_GOOD_ADD("sg")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ADD("sg", MIDWAY_SOUNDS_GOOD, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MCFG_WATCHDOG_MODIFY("watchdog")
MCFG_WATCHDOG_VBLANK_INIT("screen", 800)
@@ -1118,26 +1118,26 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( spyhunt2, mcr68 )
/* basic machine hardware */
- MCFG_MIDWAY_SOUNDS_GOOD_ADD("sg")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
- MCFG_MIDWAY_TURBO_CHIP_SQUEAK_ADD("tcs")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ADD("sg", MIDWAY_SOUNDS_GOOD, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
+ MCFG_SOUND_ADD("tcs", MIDWAY_TURBO_CHIP_SQUEAK, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( archrivl, mcr68 )
/* basic machine hardware */
- MCFG_WILLIAMS_CVSD_SOUND_ADD("cvsd")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ADD("cvsd", WILLIAMS_CVSD_SOUND, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( pigskin, mcr68 )
/* basic machine hardware */
- MCFG_WILLIAMS_CVSD_SOUND_ADD("cvsd")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ADD("cvsd", WILLIAMS_CVSD_SOUND, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(pigskin_map)
@@ -1147,8 +1147,8 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( trisport, mcr68 )
/* basic machine hardware */
- MCFG_WILLIAMS_CVSD_SOUND_ADD("cvsd")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ADD("cvsd", WILLIAMS_CVSD_SOUND, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(trisport_map)
diff --git a/src/mame/drivers/meadows.cpp b/src/mame/drivers/meadows.cpp
index f97ee965bce..ff2e5847de6 100644
--- a/src/mame/drivers/meadows.cpp
+++ b/src/mame/drivers/meadows.cpp
@@ -119,7 +119,7 @@
***************************************************************************/
#include "includes/meadows.h"
-
+#include "sound/volt_reg.h"
#include "deadeye.lh"
#include "gypsyjug.lh"
#include "minferno.lh"
@@ -242,7 +242,7 @@ WRITE8_MEMBER(meadows_state::audio_hardware_w)
switch (offset & 3)
{
case 0: /* DAC */
- meadows_sh_dac_w(data ^ 0xff);
+ m_dac->write(data ^ 0xff);
break;
case 1: /* counter clk 5 MHz / 256 */
@@ -631,15 +631,15 @@ static MACHINE_CONFIG_START( meadows, meadows_state )
MCFG_PALETTE_ADD_MONOCHROME("palette")
/* audio hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
-
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MCFG_SOUND_ADD("samples", SAMPLES, 0)
MCFG_SAMPLES_CHANNELS(2)
MCFG_SAMPLES_START_CB(meadows_state, meadows_sh_start)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
@@ -692,20 +692,20 @@ static MACHINE_CONFIG_START( bowl3d, meadows_state )
MCFG_PALETTE_ADD_MONOCHROME("palette")
/* audio hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
-
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MCFG_SOUND_ADD("samples", SAMPLES, 0)
MCFG_SAMPLES_CHANNELS(2)
MCFG_SAMPLES_START_CB(meadows_state, meadows_sh_start)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MCFG_SOUND_ADD("samples2", SAMPLES, 0)
MCFG_SAMPLES_CHANNELS(1)
MCFG_SAMPLES_NAMES(bowl3d_sample_names)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/megazone.cpp b/src/mame/drivers/megazone.cpp
index a41aa788cf0..94738431af1 100644
--- a/src/mame/drivers/megazone.cpp
+++ b/src/mame/drivers/megazone.cpp
@@ -9,17 +9,18 @@ To enter service mode, keep 1&2 pressed on reset
***************************************************************************/
#include "emu.h"
-#include "machine/konami1.h"
+#include "includes/konamipt.h"
+#include "includes/megazone.h"
#include "cpu/m6809/m6809.h"
#include "cpu/mcs48/mcs48.h"
#include "cpu/z80/z80.h"
#include "machine/gen_latch.h"
+#include "machine/konami1.h"
#include "machine/watchdog.h"
#include "sound/ay8910.h"
#include "sound/dac.h"
#include "sound/flt_rc.h"
-#include "includes/konamipt.h"
-#include "includes/megazone.h"
+#include "sound/volt_reg.h"
READ8_MEMBER(megazone_state::megazone_port_a_r)
@@ -126,7 +127,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( megazone_i8039_io_map, AS_IO, 8, megazone_state )
AM_RANGE(0x00, 0xff) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
- AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_DEVWRITE("dac", dac_device, write_unsigned8)
+ AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_WRITE(i8039_irqen_and_status_w)
ADDRESS_MAP_END
@@ -268,7 +269,7 @@ static MACHINE_CONFIG_START( megazone, megazone_state )
MCFG_PALETTE_INIT_OWNER(megazone_state, megazone)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
@@ -279,15 +280,16 @@ static MACHINE_CONFIG_START( megazone, megazone_state )
MCFG_SOUND_ROUTE(1, "filter.0.1", 0.30)
MCFG_SOUND_ROUTE(2, "filter.0.2", 0.30)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MCFG_FILTER_RC_ADD("filter.0.0", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MCFG_FILTER_RC_ADD("filter.0.1", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MCFG_FILTER_RC_ADD("filter.0.2", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/meyc8080.cpp b/src/mame/drivers/meyc8080.cpp
index abd0cb8f070..095c615ae2e 100644
--- a/src/mame/drivers/meyc8080.cpp
+++ b/src/mame/drivers/meyc8080.cpp
@@ -57,8 +57,9 @@
#include "emu.h"
#include "cpu/i8085/i8085.h"
-#include "sound/dac.h"
#include "machine/nvram.h"
+#include "sound/dac.h"
+#include "sound/volt_reg.h"
#include "wldarrow.lh"
#include "mdrawpkr.lh"
@@ -89,7 +90,7 @@ public:
DECLARE_WRITE8_MEMBER(meyc8080_dac_4_w);
UINT32 screen_update_meyc8080(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
required_device<cpu_device> m_maincpu;
- required_device<dac_device> m_dac;
+ required_device<dac_byte_interface> m_dac;
};
@@ -276,25 +277,25 @@ WRITE8_MEMBER(meyc8080_state::counters_w)
WRITE8_MEMBER(meyc8080_state::meyc8080_dac_1_w)
{
- m_dac->write_unsigned8(0x00);
+ m_dac->write(0);
}
WRITE8_MEMBER(meyc8080_state::meyc8080_dac_2_w)
{
- m_dac->write_unsigned8(0x55);
+ m_dac->write(1);
}
WRITE8_MEMBER(meyc8080_state::meyc8080_dac_3_w)
{
- m_dac->write_unsigned8(0xaa);
+ m_dac->write(2);
}
WRITE8_MEMBER(meyc8080_state::meyc8080_dac_4_w)
{
- m_dac->write_unsigned8(0xff);
+ m_dac->write(3);
}
@@ -592,9 +593,10 @@ static MACHINE_CONFIG_START( meyc8080, meyc8080_state )
MCFG_SCREEN_UPDATE_DRIVER(meyc8080_state, screen_update_meyc8080)
/* audio hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_2BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.66) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/meyc8088.cpp b/src/mame/drivers/meyc8088.cpp
index 28a11ecb608..3930afc0fc1 100644
--- a/src/mame/drivers/meyc8088.cpp
+++ b/src/mame/drivers/meyc8088.cpp
@@ -30,8 +30,8 @@
#include "machine/i8155.h"
#include "machine/nvram.h"
#include "sound/dac.h"
+#include "sound/volt_reg.h"
#include "video/resnet.h"
-
#include "gldarrow.lh"
@@ -43,14 +43,12 @@ public:
m_maincpu(*this,"maincpu"),
m_vram(*this, "vram"),
m_heartbeat(*this, "heartbeat"),
- m_dac(*this, "dac"),
m_switches(*this, {"C0", "C1", "C2", "C3"})
{ }
required_device<cpu_device> m_maincpu;
required_shared_ptr<UINT8> m_vram;
required_device<timer_device> m_heartbeat;
- required_device<dac_device> m_dac;
optional_ioport_array<4> m_switches;
@@ -68,7 +66,6 @@ public:
DECLARE_WRITE8_MEMBER(meyc8088_lights2_w);
DECLARE_WRITE8_MEMBER(meyc8088_common_w);
- DECLARE_WRITE_LINE_MEMBER(meyc8088_sound_out);
DECLARE_PALETTE_INIT(meyc8088);
UINT32 screen_update_meyc8088(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void screen_eof_meyc8088(screen_device &screen, bool state);
@@ -280,11 +277,6 @@ WRITE8_MEMBER(meyc8088_state::meyc8088_common_w)
m_common = data >> 2 & 0xf;
}
-WRITE_LINE_MEMBER(meyc8088_state::meyc8088_sound_out)
-{
- m_dac->write_signed8(state ? 0x7f : 0);
-}
-
/***************************************************************************
@@ -368,7 +360,7 @@ static MACHINE_CONFIG_START( meyc8088, meyc8088_state )
MCFG_I8155_OUT_PORTA_CB(WRITE8(meyc8088_state, meyc8088_lights2_w))
MCFG_I8155_OUT_PORTB_CB(WRITE8(meyc8088_state, meyc8088_lights1_w))
MCFG_I8155_OUT_PORTC_CB(WRITE8(meyc8088_state, meyc8088_common_w))
- MCFG_I8155_OUT_TIMEROUT_CB(WRITELINE(meyc8088_state, meyc8088_sound_out))
+ MCFG_I8155_OUT_TIMEROUT_CB(DEVWRITELINE("dac", dac_bit_interface, write))
MCFG_NVRAM_ADD_0FILL("nvram")
@@ -385,10 +377,11 @@ static MACHINE_CONFIG_START( meyc8088, meyc8088_state )
MCFG_PALETTE_INIT_OWNER(meyc8088_state, meyc8088)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SOUND_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/microtan.cpp b/src/mame/drivers/microtan.cpp
index fcf0676cb15..9b97bb0d17b 100644
--- a/src/mame/drivers/microtan.cpp
+++ b/src/mame/drivers/microtan.cpp
@@ -44,7 +44,6 @@
/* Components */
#include "sound/ay8910.h"
-#include "sound/dac.h"
#include "sound/wave.h"
#include "machine/6522via.h"
#include "machine/mos6551.h"
@@ -228,15 +227,13 @@ static MACHINE_CONFIG_START( microtan, microtan_state )
MCFG_PALETTE_ADD_MONOCHROME("palette")
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("dac", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
MCFG_SOUND_ADD("ay8910.1", AY8910, 1000000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
MCFG_SOUND_ADD("ay8910.2", AY8910, 1000000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
/* snapshot/quickload */
MCFG_SNAPSHOT_ADD("snapshot", microtan_state, microtan, "m65", 0.5)
diff --git a/src/mame/drivers/microvsn.cpp b/src/mame/drivers/microvsn.cpp
index dbc4865ecfc..abf820992a4 100644
--- a/src/mame/drivers/microvsn.cpp
+++ b/src/mame/drivers/microvsn.cpp
@@ -16,13 +16,13 @@ of the games were clocked at around 500KHz, 550KHz, or 300KHz.
****************************************************************************/
#include "emu.h"
+#include "bus/generic/slot.h"
+#include "bus/generic/carts.h"
#include "cpu/mcs48/mcs48.h"
#include "cpu/tms1000/tms1100.h"
#include "sound/dac.h"
+#include "sound/volt_reg.h"
#include "rendlay.h"
-
-#include "bus/generic/slot.h"
-#include "bus/generic/carts.h"
#include "softlist.h"
#define LOG 0
@@ -89,7 +89,7 @@ public:
rc_type m_rc_type;
protected:
- required_device<dac_device> m_dac;
+ required_device<dac_byte_interface> m_dac;
required_device<cpu_device> m_i8021;
required_device<cpu_device> m_tms1100;
required_device<generic_slot_device> m_cart;
@@ -111,7 +111,6 @@ protected:
// generic variables
void update_lcd();
void lcd_write(UINT8 control, UINT8 data);
- void speaker_write(UINT8 speaker);
bool m_pla;
UINT8 m_lcd_latch[8];
@@ -314,17 +313,6 @@ void microvision_state::lcd_write(UINT8 control, UINT8 data)
}
-/*
-speaker is SPKR1 SPKR0
-*/
-void microvision_state::speaker_write(UINT8 speaker)
-{
- const INT8 speaker_level[4] = { 0, 127, -128, 0 };
-
- m_dac->write_signed8( speaker_level[ speaker & 0x03 ] );
-}
-
-
void microvision_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
switch ( id )
@@ -381,7 +369,7 @@ WRITE8_MEMBER( microvision_state::i8021_p2_write )
m_p2 = data;
- speaker_write( m_p2 & 0x03 );
+ m_dac->write(m_p2 & 0x03);
if ( m_p2 & 0x0c )
{
@@ -488,7 +476,7 @@ WRITE16_MEMBER( microvision_state::tms1100_write_r )
m_r = data;
- speaker_write( ( ( m_r & 0x01 ) << 1 ) | ( ( m_r & 0x02 ) >> 1 ) );
+ m_dac->write((BIT(m_r, 0) << 1) | BIT(m_r, 1));
lcd_write( ( m_r >> 6 ) & 0x03, m_o & 0x0f );
}
@@ -681,9 +669,10 @@ static MACHINE_CONFIG_START( microvision, microvision_state )
MCFG_DEFAULT_LAYOUT(layout_lcd)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("dac", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_2BIT_BINARY_WEIGHTED_ONES_COMPLEMENT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "microvision_cart")
MCFG_GENERIC_MANDATORY
diff --git a/src/mame/drivers/midtunit.cpp b/src/mame/drivers/midtunit.cpp
index a54bed49a1f..d6d3a606fff 100644
--- a/src/mame/drivers/midtunit.cpp
+++ b/src/mame/drivers/midtunit.cpp
@@ -621,9 +621,9 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( tunit_adpcm, tunit_core )
/* basic machine hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_WILLIAMS_ADPCM_SOUND_ADD("adpcm")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("adpcm", WILLIAMS_ADPCM_SOUND, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/midyunit.cpp b/src/mame/drivers/midyunit.cpp
index 4887dd68ee3..7fd9c9dea4f 100644
--- a/src/mame/drivers/midyunit.cpp
+++ b/src/mame/drivers/midyunit.cpp
@@ -1096,7 +1096,7 @@ static MACHINE_CONFIG_START( zunit, midyunit_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
- MCFG_WILLIAMS_NARC_SOUND_ADD("narcsnd")
+ MCFG_SOUND_ADD("narcsnd", WILLIAMS_NARC_SOUND, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
MACHINE_CONFIG_END
@@ -1136,15 +1136,15 @@ static MACHINE_CONFIG_START( yunit_core, midyunit_state )
MCFG_SCREEN_PALETTE("palette")
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( yunit_cvsd_4bit_slow, yunit_core )
/* basic machine hardware */
- MCFG_WILLIAMS_CVSD_SOUND_ADD("cvsd")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ADD("cvsd", WILLIAMS_CVSD_SOUND, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
/* video hardware */
MCFG_PALETTE_MODIFY("palette")
@@ -1159,8 +1159,8 @@ static MACHINE_CONFIG_DERIVED( yunit_cvsd_4bit_fast, yunit_core )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_CLOCK(FAST_MASTER_CLOCK)
- MCFG_WILLIAMS_CVSD_SOUND_ADD("cvsd")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ADD("cvsd", WILLIAMS_CVSD_SOUND, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
/* video hardware */
MCFG_PALETTE_MODIFY("palette")
@@ -1172,8 +1172,8 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( yunit_cvsd_6bit_slow, yunit_core )
/* basic machine hardware */
- MCFG_WILLIAMS_CVSD_SOUND_ADD("cvsd")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ADD("cvsd", WILLIAMS_CVSD_SOUND, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
/* video hardware */
MCFG_PALETTE_MODIFY("palette")
@@ -1188,8 +1188,8 @@ static MACHINE_CONFIG_DERIVED( yunit_adpcm_6bit_fast, yunit_core )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_CLOCK(FAST_MASTER_CLOCK)
- MCFG_WILLIAMS_ADPCM_SOUND_ADD("adpcm")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ADD("adpcm", WILLIAMS_ADPCM_SOUND, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
/* video hardware */
MCFG_PALETTE_MODIFY("palette")
@@ -1204,8 +1204,8 @@ static MACHINE_CONFIG_DERIVED( yunit_adpcm_6bit_faster, yunit_core )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_CLOCK(FASTER_MASTER_CLOCK)
- MCFG_WILLIAMS_ADPCM_SOUND_ADD("adpcm")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ADD("adpcm", WILLIAMS_ADPCM_SOUND, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
/* video hardware */
MCFG_PALETTE_MODIFY("palette")
@@ -1231,7 +1231,7 @@ static MACHINE_CONFIG_DERIVED( mkyawdim, yunit_core )
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_OKIM6295_ADD("oki", XTAL_8MHz / 8, OKIM6295_PIN7_HIGH)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/mikro80.cpp b/src/mame/drivers/mikro80.cpp
index ae543027dfc..083edea51da 100644
--- a/src/mame/drivers/mikro80.cpp
+++ b/src/mame/drivers/mikro80.cpp
@@ -11,10 +11,10 @@
#include "emu.h"
#include "cpu/i8085/i8085.h"
-#include "sound/wave.h"
-#include "includes/mikro80.h"
#include "formats/rk_cas.h"
-#include "sound/dac.h"
+#include "includes/mikro80.h"
+#include "sound/volt_reg.h"
+#include "sound/wave.h"
#include "softlist.h"
/* Address maps */
@@ -41,7 +41,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( radio99_io , AS_IO, 8, mikro80_state )
ADDRESS_MAP_UNMAP_HIGH
AM_RANGE( 0x01, 0x01) AM_READWRITE(mikro80_tape_r, mikro80_tape_w )
- AM_RANGE( 0x04, 0x04) AM_DEVWRITE("dac", dac_device, write_unsigned8)
+ AM_RANGE( 0x04, 0x04) AM_WRITE(radio99_sound_w)
AM_RANGE( 0x05, 0x05) AM_READWRITE(mikro80_8255_portc_r, mikro80_8255_portc_w )
AM_RANGE( 0x06, 0x06) AM_READ(mikro80_8255_portb_r)
AM_RANGE( 0x07, 0x07) AM_WRITE(mikro80_8255_porta_w)
@@ -181,9 +181,9 @@ static MACHINE_CONFIG_START( mikro80, mikro80_state )
MCFG_GFXDECODE_ADD("gfxdecode", "palette", mikro80)
MCFG_PALETTE_ADD_MONOCHROME("palette")
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
MCFG_CASSETTE_ADD( "cassette" )
MCFG_CASSETTE_FORMATS(rk8_cassette_formats)
@@ -199,8 +199,9 @@ static MACHINE_CONFIG_DERIVED( radio99, mikro80 )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_IO_MAP(radio99_io)
- MCFG_SOUND_ADD("dac", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 16.00)
+ MCFG_SOUND_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.12)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( kristall, mikro80 )
diff --git a/src/mame/drivers/mini2440.cpp b/src/mame/drivers/mini2440.cpp
index b0f27510098..afc143249d8 100644
--- a/src/mame/drivers/mini2440.cpp
+++ b/src/mame/drivers/mini2440.cpp
@@ -11,6 +11,7 @@
#include "machine/s3c2440.h"
#include "machine/smartmed.h"
#include "sound/dac.h"
+#include "sound/volt_reg.h"
#include "rendlay.h"
#define VERBOSE_LEVEL ( 0 )
@@ -23,16 +24,16 @@ public:
m_maincpu(*this, "maincpu"),
m_s3c2440(*this, "s3c2440"),
m_nand(*this, "nand"),
- m_dac1(*this, "dac1"),
- m_dac2(*this, "dac2"),
+ m_ldac(*this, "ldac"),
+ m_rdac(*this, "rdac"),
m_penx(*this, "PENX"),
m_peny(*this, "PENY") { }
required_device<cpu_device> m_maincpu;
required_device<s3c2440_device> m_s3c2440;
required_device<nand_device> m_nand;
- required_device<dac_device> m_dac1;
- required_device<dac_device> m_dac2;
+ required_device<dac_word_interface> m_ldac;
+ required_device<dac_word_interface> m_rdac;
required_ioport m_penx;
required_ioport m_peny;
@@ -92,6 +93,10 @@ READ32_MEMBER(mini2440_state::s3c2440_gpio_port_r)
WRITE32_MEMBER(mini2440_state::s3c2440_gpio_port_w)
{
+ // tout2/gb2 -> uda1341ts l3mode
+ // tout3/gb3 -> uda1341ts l3data
+ // tclk0/gb4 -> uda1341ts l3clock
+
m_port[offset] = data;
switch (offset)
{
@@ -154,9 +159,9 @@ WRITE8_MEMBER(mini2440_state::s3c2440_nand_data_w )
WRITE16_MEMBER(mini2440_state::s3c2440_i2s_data_w )
{
if ( offset )
- m_dac1->write_signed16(data + 0x8000);
+ m_ldac->write(data);
else
- m_dac2->write_signed16(data + 0x8000);
+ m_rdac->write(data);
}
// ADC
@@ -227,10 +232,11 @@ static MACHINE_CONFIG_START( mini2440, mini2440_state )
MCFG_SCREEN_UPDATE_DEVICE("s3c2440", s3c2440_device, screen_update)
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
- MCFG_SOUND_ADD("dac1", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_SOUND_ADD("dac2", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
+ MCFG_SOUND_ADD("ldac", UDA1341TS, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) // uda1341ts.u12
+ MCFG_SOUND_ADD("rdac", UDA1341TS, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) // uda1341ts.u12
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "ldac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "ldac", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "rdac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "rdac", -1.0, DAC_VREF_NEG_INPUT)
MCFG_DEVICE_ADD("s3c2440", S3C2440, 12000000)
MCFG_S3C2440_PALETTE("palette")
diff --git a/src/mame/drivers/mjsister.cpp b/src/mame/drivers/mjsister.cpp
index bc306fb5dd8..aa2e45514d8 100644
--- a/src/mame/drivers/mjsister.cpp
+++ b/src/mame/drivers/mjsister.cpp
@@ -10,8 +10,9 @@
#include "emu.h"
#include "cpu/z80/z80.h"
-#include "sound/dac.h"
#include "sound/ay8910.h"
+#include "sound/dac.h"
+#include "sound/volt_reg.h"
#define MCLK 12000000
@@ -55,7 +56,7 @@ public:
/* devices */
required_device<cpu_device> m_maincpu;
required_device<palette_device> m_palette;
- required_device<dac_device> m_dac;
+ required_device<dac_byte_interface> m_dac;
/* memory */
UINT8 m_videoram0[0x8000];
@@ -197,7 +198,7 @@ TIMER_CALLBACK_MEMBER(mjsister_state::dac_callback)
{
UINT8 *DACROM = memregion("samples")->base();
- m_dac->write_unsigned8(DACROM[(m_dac_bank * 0x10000 + m_dac_adr++) & 0x1ffff]);
+ m_dac->write(DACROM[(m_dac_bank * 0x10000 + m_dac_adr++) & 0x1ffff]);
if (((m_dac_adr & 0xff00 ) >> 8) != m_dac_adr_e)
timer_set(attotime::from_hz(MCLK) * 1024, TIMER_DAC);
@@ -497,15 +498,16 @@ static MACHINE_CONFIG_START( mjsister, mjsister_state )
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_SOUND_ADD("aysnd", AY8910, MCLK/8)
MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW1"))
MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSW2"))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.15)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.15)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
/*************************************
diff --git a/src/mame/drivers/mk14.cpp b/src/mame/drivers/mk14.cpp
index e152fcbc144..4018daf4c47 100644
--- a/src/mame/drivers/mk14.cpp
+++ b/src/mame/drivers/mk14.cpp
@@ -34,10 +34,11 @@ ToDo:
#include "emu.h"
#include "cpu/scmp/scmp.h"
+#include "imagedev/cassette.h"
#include "machine/ins8154.h"
#include "sound/dac.h"
+#include "sound/volt_reg.h"
#include "sound/wave.h"
-#include "imagedev/cassette.h"
#include "mk14.lh"
@@ -62,7 +63,7 @@ private:
required_device<cpu_device> m_maincpu;
required_ioport_array<8> m_keyboard;
required_device<cassette_image_device> m_cass;
- required_device<dac_device> m_dac;
+ required_device<dac_bit_interface> m_dac;
};
/*
@@ -172,7 +173,7 @@ WRITE8_MEMBER( mk14_state::port_a_w )
WRITE_LINE_MEMBER( mk14_state::cass_w )
{
m_cass->output(state ? -1.0 : +1.0);
- m_dac->write_unsigned8(state ? 0x40 : 0);
+ m_dac->write(state);
}
READ_LINE_MEMBER( mk14_state::cass_r )
@@ -195,16 +196,19 @@ static MACHINE_CONFIG_START( mk14, mk14_state )
MCFG_DEFAULT_LAYOUT(layout_mk14)
// sound
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.05)
- MCFG_SOUND_ADD("dac", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.05)
+ MCFG_SOUND_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
+ MCFG_SOUND_ADD("dac8", ZN425E, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) // Ferranti ZN425E
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac8", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac8", -1.0, DAC_VREF_NEG_INPUT)
/* devices */
MCFG_DEVICE_ADD("ic8", INS8154, 0)
MCFG_INS8154_OUT_A_CB(WRITE8(mk14_state, port_a_w))
- MCFG_INS8154_OUT_B_CB(DEVWRITE8("dac", dac_device, write_unsigned8))
+ MCFG_INS8154_OUT_B_CB(DEVWRITE8("dac8", dac_byte_interface, write))
MCFG_CASSETTE_ADD( "cassette" )
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/mogura.cpp b/src/mame/drivers/mogura.cpp
index 2b175343017..9040ec0e35d 100644
--- a/src/mame/drivers/mogura.cpp
+++ b/src/mame/drivers/mogura.cpp
@@ -4,8 +4,9 @@
#include "emu.h"
#include "cpu/z80/z80.h"
-#include "sound/dac.h"
#include "includes/konamipt.h"
+#include "sound/dac.h"
+#include "sound/volt_reg.h"
class mogura_state : public driver_device
{
@@ -13,16 +14,16 @@ public:
mogura_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
- m_dac1(*this, "dac1"),
- m_dac2(*this, "dac2"),
+ m_ldac(*this, "ldac"),
+ m_rdac(*this, "rdac"),
m_gfxram(*this, "gfxram"),
m_tileram(*this, "tileram"),
m_gfxdecode(*this, "gfxdecode")
{ }
required_device<cpu_device> m_maincpu;
- required_device<dac_device> m_dac1;
- required_device<dac_device> m_dac2;
+ required_device<dac_byte_interface> m_ldac;
+ required_device<dac_byte_interface> m_rdac;
required_shared_ptr<UINT8> m_gfxram;
required_shared_ptr<UINT8> m_tileram;
required_device<gfxdecode_device> m_gfxdecode;
@@ -116,8 +117,8 @@ WRITE8_MEMBER(mogura_state::mogura_tileram_w)
WRITE8_MEMBER(mogura_state::mogura_dac_w)
{
- m_dac1->write_unsigned8(data & 0xf0); /* left */
- m_dac2->write_unsigned8((data & 0x0f) << 4); /* right */
+ m_ldac->write(data >> 4);
+ m_rdac->write(data & 15);
}
@@ -220,13 +221,12 @@ static MACHINE_CONFIG_START( mogura, mogura_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
-
- MCFG_DAC_ADD("dac1")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.50)
-
- MCFG_DAC_ADD("dac2")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.50)
-MACHINE_CONFIG_END
+ MCFG_SOUND_ADD("ldac", DAC_4BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.25) // unknown DAC
+ MCFG_SOUND_ADD("rdac", DAC_4BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.25) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "ldac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "ldac", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "rdac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "rdac", -1.0, DAC_VREF_NEG_INPUT)
+ MACHINE_CONFIG_END
ROM_START( mogura )
diff --git a/src/mame/drivers/mrgame.cpp b/src/mame/drivers/mrgame.cpp
index f3f6192b36c..a17570c5b2e 100644
--- a/src/mame/drivers/mrgame.cpp
+++ b/src/mame/drivers/mrgame.cpp
@@ -35,11 +35,12 @@ ToDo:
#include "emu.h"
#include "cpu/m68000/m68000.h"
#include "cpu/z80/z80.h"
+#include "machine/i8255.h"
#include "machine/nvram.h"
-#include "video/resnet.h"
-#include "sound/tms5220.h"
#include "sound/dac.h"
-#include "machine/i8255.h"
+#include "sound/tms5220.h"
+#include "sound/volt_reg.h"
+#include "video/resnet.h"
class mrgame_state : public driver_device
{
@@ -135,7 +136,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( audio1_io, AS_IO, 8, mrgame_state )
ADDRESS_MAP_GLOBAL_MASK(3)
- AM_RANGE(0x0000, 0x0000) AM_WRITENOP //AM_DEVWRITE("dac", dac_device, write_unsigned8) //DA1. The DC output might be an electronic volume control of the M114's output.
+ AM_RANGE(0x0000, 0x0000) AM_DEVWRITE("dacvol", dac_byte_interface, write) //DA1
AM_RANGE(0x0001, 0x0001) AM_READ(sound_r) //IN1
AM_RANGE(0x0002, 0x0002) AM_WRITE(ack1_w) //AKL1
AM_RANGE(0x0003, 0x0003) AM_WRITENOP //SGS pass data to M114
@@ -148,11 +149,11 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( audio2_io, AS_IO, 8, mrgame_state )
ADDRESS_MAP_GLOBAL_MASK(7)
- AM_RANGE(0x0000, 0x0000) AM_DEVWRITE("dacl", dac_device, write_unsigned8) //DA2
+ AM_RANGE(0x0000, 0x0000) AM_DEVWRITE("ldac", dac_byte_interface, write) //DA2
AM_RANGE(0x0001, 0x0001) AM_READ(sound_r) //IN2
AM_RANGE(0x0002, 0x0002) AM_WRITE(ack2_w) //AKL2
AM_RANGE(0x0003, 0x0003) AM_DEVREADWRITE("tms", tms5220_device, status_r, data_w) //Speech
- AM_RANGE(0x0004, 0x0004) AM_DEVWRITE("dacr", dac_device, write_unsigned8) //DA3
+ AM_RANGE(0x0004, 0x0004) AM_DEVWRITE("rdac", dac_byte_interface, write) //DA3
ADDRESS_MAP_END
static INPUT_PORTS_START( mrgame )
@@ -487,10 +488,14 @@ static MACHINE_CONFIG_START( mrgame, mrgame_state )
/* Sound */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
- MCFG_DAC_ADD("dacl")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.50)
- MCFG_DAC_ADD("dacr")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.50)
+ MCFG_SOUND_ADD("ldac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.25) // unknown DAC
+ MCFG_SOUND_ADD("rdac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.25) // unknown DAC
+ MCFG_SOUND_ADD("dacvol", DAC_8BIT_R2R, 0) // unknown DAC
+ MCFG_SOUND_ROUTE_EX(0, "ldac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "ldac", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "rdac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "rdac", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dacvol", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dacvol", -1.0, DAC_VREF_NEG_INPUT)
+
MCFG_SOUND_ADD("tms", TMS5220, 672000) // uses a RC combination. 672k copied from jedi.h
MCFG_TMS52XX_READYQ_HANDLER(INPUTLINE("audiocpu2", Z80_INPUT_LINE_BOGUSWAIT))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
diff --git a/src/mame/drivers/msx.cpp b/src/mame/drivers/msx.cpp
index 2e8fa7fcc90..02ffb7393ed 100644
--- a/src/mame/drivers/msx.cpp
+++ b/src/mame/drivers/msx.cpp
@@ -532,6 +532,7 @@ PCB Layouts missing
#include "machine/msx_matsushita.h"
#include "machine/msx_s1985.h"
#include "machine/msx_systemflags.h"
+#include "sound/volt_reg.h"
#include "softlist.h"
@@ -1334,7 +1335,7 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_FRAGMENT( msx_ym2413 )
MCFG_SOUND_ADD("ym2413", YM2413, XTAL_21_4772MHz/6)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.4)
MACHINE_CONFIG_END
static MACHINE_CONFIG_FRAGMENT( msx2_64kb_vram )
@@ -1356,18 +1357,20 @@ static MACHINE_CONFIG_START( msx, msx_state )
MCFG_I8255_OUT_PORTC_CB(WRITE8(msx_state, msx_ppi_port_c_w))
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("dac", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.1)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT)
+
MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
MCFG_SOUND_ADD("ay8910", AY8910, XTAL_10_738635MHz/3/2)
MCFG_AY8910_OUTPUT_TYPE(AY8910_SINGLE_OUTPUT)
MCFG_AY8910_PORT_A_READ_CB(READ8(msx_state, msx_psg_port_a_r))
MCFG_AY8910_PORT_B_READ_CB(READ8(msx_state, msx_psg_port_b_r))
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(msx_state, msx_psg_port_a_w))
MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(msx_state, msx_psg_port_b_w))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.3)
/* printer */
MCFG_CENTRONICS_ADD("centronics", centronics_devices, "printer")
@@ -1498,18 +1501,20 @@ static MACHINE_CONFIG_START( msx2, msx_state )
MCFG_V99X8_SCREEN_ADD_NTSC("screen", "v9938", XTAL_21_4772MHz)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("dac", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.1)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT)
+
MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
MCFG_SOUND_ADD("ay8910", AY8910, XTAL_21_4772MHz/6/2)
MCFG_AY8910_OUTPUT_TYPE(AY8910_SINGLE_OUTPUT)
MCFG_AY8910_PORT_A_READ_CB(READ8(msx_state, msx_psg_port_a_r))
MCFG_AY8910_PORT_B_READ_CB(READ8(msx_state, msx_psg_port_b_r))
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(msx_state, msx_psg_port_a_w))
MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(msx_state, msx_psg_port_b_w))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.3)
/* printer */
MCFG_CENTRONICS_ADD("centronics", centronics_devices, "printer")
@@ -1554,18 +1559,20 @@ static MACHINE_CONFIG_START( msx2p, msx_state )
MCFG_V99X8_SCREEN_ADD_NTSC("screen", "v9958", XTAL_21_4772MHz)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("dac", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.1)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT)
+
MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
MCFG_SOUND_ADD("ay8910", AY8910, XTAL_21_4772MHz/6/2)
MCFG_AY8910_OUTPUT_TYPE(AY8910_SINGLE_OUTPUT)
MCFG_AY8910_PORT_A_READ_CB(READ8(msx_state, msx_psg_port_a_r))
MCFG_AY8910_PORT_B_READ_CB(READ8(msx_state, msx_psg_port_b_r))
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(msx_state, msx_psg_port_a_w))
MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(msx_state, msx_psg_port_b_w))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.3)
/* printer */
MCFG_CENTRONICS_ADD("centronics", centronics_devices, "printer")
diff --git a/src/mame/drivers/multigam.cpp b/src/mame/drivers/multigam.cpp
index 5e49c9fe7bc..3fbb31d4c79 100644
--- a/src/mame/drivers/multigam.cpp
+++ b/src/mame/drivers/multigam.cpp
@@ -108,7 +108,6 @@ Eproms are 27512,27010,274001
#include "emu.h"
#include "cpu/m6502/n2a03.h"
-#include "sound/dac.h"
#include "video/ppu2c0x.h"
diff --git a/src/mame/drivers/murogem.cpp b/src/mame/drivers/murogem.cpp
index 3df8476b7d4..a39c141e09d 100644
--- a/src/mame/drivers/murogem.cpp
+++ b/src/mame/drivers/murogem.cpp
@@ -110,6 +110,7 @@ val (hex): 27 20 22 04 26 00 20 20 00 07 00 00 80 00 00 00 ns
#include "cpu/m6800/m6800.h"
#include "video/mc6845.h"
#include "sound/dac.h"
+#include "sound/volt_reg.h"
class murogem_state : public driver_device
@@ -124,7 +125,7 @@ public:
m_videoram(*this, "videoram") { }
required_device<cpu_device> m_maincpu;
- required_device<dac_device> m_dac;
+ required_device<dac_bit_interface> m_dac;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
@@ -146,7 +147,7 @@ WRITE8_MEMBER(murogem_state::outport_w)
7654 3210
---- x--- Sound DAC.
*/
- m_dac->write_unsigned8(data & 0x08);
+ m_dac->write(BIT(data, 3));
}
@@ -266,9 +267,10 @@ static MACHINE_CONFIG_START( murogem, murogem_state )
MCFG_MC6845_CHAR_WIDTH(8)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 12.00)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.375)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/murogmbl.cpp b/src/mame/drivers/murogmbl.cpp
index 245f6c3953b..fead2b8200b 100644
--- a/src/mame/drivers/murogmbl.cpp
+++ b/src/mame/drivers/murogmbl.cpp
@@ -38,6 +38,7 @@ Dumped: 06/04/2009 f205v
#include "emu.h"
#include "cpu/z80/z80.h"
#include "sound/dac.h"
+#include "sound/volt_reg.h"
class murogmbl_state : public driver_device
@@ -98,7 +99,7 @@ static ADDRESS_MAP_START( murogmbl_map, AS_PROGRAM, 8, murogmbl_state )
AM_RANGE(0x6000, 0x6000) AM_READ_PORT("IN0")
AM_RANGE(0x6800, 0x6800) AM_READ_PORT("DSW")
AM_RANGE(0x7000, 0x7000) AM_READ_PORT("IN1")
- AM_RANGE(0x7800, 0x7800) AM_READNOP AM_DEVWRITE("dac1", dac_device, write_unsigned8) /* read is always discarded */
+ AM_RANGE(0x7800, 0x7800) AM_READNOP AM_DEVWRITE("dac", dac_byte_interface, write) /* read is always discarded */
ADDRESS_MAP_END
void murogmbl_state::video_start()
@@ -210,9 +211,10 @@ static MACHINE_CONFIG_START( murogmbl, murogmbl_state )
MCFG_PALETTE_ADD("palette", 0x100)
MCFG_PALETTE_INIT_OWNER(murogmbl_state, murogmbl)
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DAC_ADD("dac1")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/namcos1.cpp b/src/mame/drivers/namcos1.cpp
index 8bc2cd87d73..b206478d92e 100644
--- a/src/mame/drivers/namcos1.cpp
+++ b/src/mame/drivers/namcos1.cpp
@@ -336,11 +336,12 @@ C - uses sub board with support for player 3 and 4 controls
***********************************************************************/
#include "emu.h"
+#include "includes/namcos1.h"
#include "cpu/m6809/m6809.h"
#include "cpu/m6800/m6800.h"
-#include "sound/ym2151.h"
#include "machine/nvram.h"
-#include "includes/namcos1.h"
+#include "sound/volt_reg.h"
+#include "sound/ym2151.h"
/**********************************************************************/
@@ -365,44 +366,15 @@ WRITE8_MEMBER(namcos1_state::coin_w)
machine().bookkeeping().coin_counter_w(1, data & 4);
}
-void namcos1_state::update_DACs()
-{
- m_dac->write_signed16(0x8000 + (m_dac0_value * m_dac0_gain) + (m_dac1_value * m_dac1_gain));
-}
-
-void namcos1_state::init_DACs()
-{
- m_dac0_value = 0;
- m_dac1_value = 0;
- m_dac0_gain = 0x80;
- m_dac1_gain = 0x80;
-}
-
WRITE8_MEMBER(namcos1_state::dac_gain_w)
{
- int value;
-
- /* DAC0 (bits 0,2) */
- value = (data & 1) | ((data >> 1) & 2); /* GAIN0,GAIN1 */
- m_dac0_gain = 0x20 * (value+1);
-
- /* DAC1 (bits 3,4) */
- value = (data >> 3) & 3; /* GAIN2,GAIN3 */
- m_dac1_gain = 0x20 * (value+1);
-
- update_DACs();
-}
+ /* DAC0 (GAIN0 = bit0, GAIN1 = bit2) */
+ int dac0_gain = (BIT(data, 2) << 1) | BIT(data, 0);
+ m_dac0->set_output_gain(ALL_OUTPUTS, (dac0_gain + 1) / 4.0f);
-WRITE8_MEMBER(namcos1_state::dac0_w)
-{
- m_dac0_value = data - 0x80; /* shift zero point */
- update_DACs();
-}
-
-WRITE8_MEMBER(namcos1_state::dac1_w)
-{
- m_dac1_value = data - 0x80; /* shift zero point */
- update_DACs();
+ /* DAC1 (GAIN2 = bit3, GAIN3 = bit4) */
+ int dac1_gain = (BIT(data, 4) << 1) | BIT(data, 3);
+ m_dac1->set_output_gain(ALL_OUTPUTS, (dac1_gain + 1) / 4.0f);
}
@@ -452,8 +424,8 @@ static ADDRESS_MAP_START( mcu_map, AS_PROGRAM, 8, namcos1_state )
AM_RANGE(0x4000, 0xbfff) AM_ROMBANK("mcubank") /* banked external ROM */
AM_RANGE(0xc000, 0xc7ff) AM_RAM AM_SHARE("triram")
AM_RANGE(0xc800, 0xcfff) AM_RAM AM_SHARE("nvram") /* EEPROM */
- AM_RANGE(0xd000, 0xd000) AM_WRITE(dac0_w)
- AM_RANGE(0xd400, 0xd400) AM_WRITE(dac1_w)
+ AM_RANGE(0xd000, 0xd000) AM_DEVWRITE("dac0", dac_byte_interface, write)
+ AM_RANGE(0xd400, 0xd400) AM_DEVWRITE("dac1", dac_byte_interface, write)
AM_RANGE(0xd800, 0xd800) AM_WRITE(mcu_bankswitch_w) /* ROM bank selector */
AM_RANGE(0xf000, 0xf000) AM_WRITE(irq_ack_w)
AM_RANGE(0xf000, 0xffff) AM_ROM AM_REGION("mcu", 0) /* internal ROM */
@@ -1096,9 +1068,11 @@ static MACHINE_CONFIG_START( ns1, namcos1_state )
MCFG_SOUND_ROUTE(0, "lspeaker", 0.50)
MCFG_SOUND_ROUTE(1, "rspeaker", 0.50)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
+ MCFG_SOUND_ADD("dac0", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.5) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.5) // unknown DAC
+ MCFG_SOUND_ADD("dac1", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.5) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.5) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac0", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac0", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac1", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac1", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/nbmj8688.cpp b/src/mame/drivers/nbmj8688.cpp
index 0fd9269c1a6..2486f59a0df 100644
--- a/src/mame/drivers/nbmj8688.cpp
+++ b/src/mame/drivers/nbmj8688.cpp
@@ -31,14 +31,15 @@ TODO:
******************************************************************************/
#include "emu.h"
+#include "includes/nbmj8688.h"
#include "cpu/z80/z80.h"
-#include "sound/dac.h"
-#include "sound/ay8910.h"
+#include "machine/nvram.h"
#include "sound/3812intf.h"
+#include "sound/ay8910.h"
+#include "sound/dac.h"
+#include "sound/volt_reg.h"
#include "rendlay.h"
#include "nbmj8688.lh"
-#include "includes/nbmj8688.h"
-#include "machine/nvram.h"
DRIVER_INIT_MEMBER(nbmj8688_state,mjcamera)
@@ -153,7 +154,7 @@ static ADDRESS_MAP_START( secolove_io_map, AS_IO, 8, nbmj8688_state )
AM_RANGE(0xb0, 0xb0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, inputport2_r, sndrombank1_w)
AM_RANGE(0xc0, 0xcf) AM_WRITE(clut_w)
AM_RANGE(0xd0, 0xd0) AM_READ(ff_r) // irq ack? watchdog?
- AM_RANGE(0xd0, 0xd0) AM_DEVWRITE("dac", dac_device, write_unsigned8)
+ AM_RANGE(0xd0, 0xd0) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(0xe0, 0xe0) AM_WRITE(secolove_romsel_w)
// AM_RANGE(0xf0, 0xf0) AM_DEVREAD("nb1413m3", nb1413m3_device, dipsw1_r)
// AM_RANGE(0xf1, 0xf1) AM_DEVREAD("nb1413m3", nb1413m3_device, dipsw2_r)
@@ -178,7 +179,7 @@ static ADDRESS_MAP_START( barline_io_map, AS_IO, 8, nbmj8688_state )
AM_RANGE(0xb0, 0xb0) AM_DEVREAD("nb1413m3", nb1413m3_device, inputport2_r) AM_WRITE(barline_output_w)
AM_RANGE(0xc0, 0xcf) AM_WRITE(clut_w)
AM_RANGE(0xd0, 0xd0) AM_READ(ff_r) // irq ack? watchdog?
-// AM_RANGE(0xd0, 0xd0) AM_DEVWRITE("dac", dac_device, write_unsigned8) //not used
+// AM_RANGE(0xd0, 0xd0) AM_DEVWRITE("dac", dac_byte_interface, write) //not used
AM_RANGE(0xe0, 0xe0) AM_WRITE(secolove_romsel_w)
AM_RANGE(0xf0, 0xf0) AM_DEVREAD("nb1413m3", nb1413m3_device, dipsw1_r) AM_WRITE(scrolly_w)
AM_RANGE(0xf1, 0xf1) AM_DEVREAD("nb1413m3", nb1413m3_device, dipsw2_r)
@@ -196,7 +197,7 @@ static ADDRESS_MAP_START( crystalg_io_map, AS_IO, 8, nbmj8688_state )
AM_RANGE(0xb0, 0xb0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, inputport2_r, sndrombank1_w)
AM_RANGE(0xc0, 0xcf) AM_WRITE(clut_w)
AM_RANGE(0xd0, 0xd0) AM_READ(ff_r) // irq ack? watchdog?
- AM_RANGE(0xd0, 0xd0) AM_DEVWRITE("dac", dac_device, write_unsigned8)
+ AM_RANGE(0xd0, 0xd0) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(0xe0, 0xe0) AM_WRITE(crystalg_romsel_w)
// AM_RANGE(0xf0, 0xf0) AM_DEVREAD("nb1413m3", nb1413m3_device, dipsw1_r)
// AM_RANGE(0xf0, 0xf0) AM_WRITENOP
@@ -216,7 +217,7 @@ static ADDRESS_MAP_START( otonano_io_map, AS_IO, 8, nbmj8688_state )
AM_RANGE(0xa0, 0xa0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, inputport1_r, inputportsel_w)
AM_RANGE(0xb0, 0xb0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, inputport2_r, sndrombank1_w)
AM_RANGE(0xd0, 0xd0) AM_READ(ff_r) // irq ack? watchdog?
- AM_RANGE(0xd0, 0xd0) AM_DEVWRITE("dac", dac_device, write_unsigned8)
+ AM_RANGE(0xd0, 0xd0) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(0xe0, 0xe0) AM_WRITE(mjsikaku_gfxflag2_w)
AM_RANGE(0xf0, 0xf0) AM_DEVREAD("nb1413m3", nb1413m3_device, dipsw1_r) AM_WRITE(scrolly_w)
AM_RANGE(0xf1, 0xf1) AM_DEVREAD("nb1413m3", nb1413m3_device, dipsw2_r)
@@ -236,7 +237,7 @@ static ADDRESS_MAP_START( kaguya_io_map, AS_IO, 8, nbmj8688_state )
AM_RANGE(0xa0, 0xa0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, inputport1_r, inputportsel_w)
AM_RANGE(0xb0, 0xb0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, inputport2_r, sndrombank1_w)
AM_RANGE(0xd0, 0xd0) AM_READ(ff_r) // irq ack? watchdog?
- AM_RANGE(0xd0, 0xd0) AM_DEVWRITE("dac", dac_device, write_unsigned8)
+ AM_RANGE(0xd0, 0xd0) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(0xe0, 0xe0) AM_WRITE(mjsikaku_gfxflag2_w)
AM_RANGE(0xf0, 0xf0) AM_DEVREAD("nb1413m3", nb1413m3_device, dipsw1_r) AM_WRITE(scrolly_w)
AM_RANGE(0xf1, 0xf1) AM_DEVREAD("nb1413m3", nb1413m3_device, dipsw2_r)
@@ -257,7 +258,7 @@ static ADDRESS_MAP_START( iemoto_io_map, AS_IO, 8, nbmj8688_state )
AM_RANGE(0xa0, 0xa0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, inputport1_r, inputportsel_w)
AM_RANGE(0xb0, 0xb0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, inputport2_r, sndrombank1_w)
AM_RANGE(0xd0, 0xd0) AM_READ(ff_r) // irq ack? watchdog?
- AM_RANGE(0xd0, 0xd0) AM_DEVWRITE("dac", dac_device, write_unsigned8)
+ AM_RANGE(0xd0, 0xd0) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(0xe0, 0xe0) AM_WRITE(mjsikaku_gfxflag2_w)
// AM_RANGE(0xf0, 0xf0) AM_DEVREAD("nb1413m3", nb1413m3_device, dipsw1_r)
// AM_RANGE(0xf1, 0xf1) AM_DEVREAD("nb1413m3", nb1413m3_device, dipsw2_r)
@@ -279,7 +280,7 @@ static ADDRESS_MAP_START( seiha_io_map, AS_IO, 8, nbmj8688_state )
AM_RANGE(0xa0, 0xa0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, inputport1_r, inputportsel_w)
AM_RANGE(0xb0, 0xb0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, inputport2_r, sndrombank1_w)
AM_RANGE(0xd0, 0xd0) AM_READ(ff_r) // irq ack? watchdog?
- AM_RANGE(0xd0, 0xd0) AM_DEVWRITE("dac", dac_device, write_unsigned8)
+ AM_RANGE(0xd0, 0xd0) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(0xe0, 0xe0) AM_WRITE(mjsikaku_gfxflag2_w)
// AM_RANGE(0xf0, 0xf0) AM_DEVREAD("nb1413m3", nb1413m3_device, dipsw1_r)
// AM_RANGE(0xf1, 0xf1) AM_DEVREAD("nb1413m3", nb1413m3_device, dipsw2_r)
@@ -299,7 +300,7 @@ static ADDRESS_MAP_START( mjgaiden_io_map, AS_IO, 8, nbmj8688_state )
AM_RANGE(0xa0, 0xa0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, inputport1_r, inputportsel_w)
AM_RANGE(0xb0, 0xb0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, inputport2_r, sndrombank1_w)
AM_RANGE(0xd0, 0xd0) AM_READ(ff_r) // irq ack? watchdog?
- AM_RANGE(0xd0, 0xd0) AM_DEVWRITE("dac", dac_device, write_unsigned8)
+ AM_RANGE(0xd0, 0xd0) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(0xe0, 0xe0) AM_WRITE(mjsikaku_gfxflag2_w)
// AM_RANGE(0xf0, 0xf0) AM_DEVREAD("nb1413m3", nb1413m3_device, dipsw1_r)
// AM_RANGE(0xf1, 0xf1) AM_DEVREAD("nb1413m3", nb1413m3_device, dipsw2_r)
@@ -324,7 +325,7 @@ static ADDRESS_MAP_START( p16bit_LCD_io_map, AS_IO, 8, nbmj8688_state )
AM_RANGE(0xb0, 0xb0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, inputport2_r, sndrombank1_w)
AM_RANGE(0xc0, 0xcf) AM_WRITE(clut_w)
AM_RANGE(0xd0, 0xd0) AM_READ(ff_r) // irq ack? watchdog?
- AM_RANGE(0xd0, 0xd0) AM_DEVWRITE("dac", dac_device, write_unsigned8)
+ AM_RANGE(0xd0, 0xd0) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(0xe0, 0xe0) AM_WRITE(secolove_romsel_w)
// AM_RANGE(0xf0, 0xf0) AM_DEVREAD("nb1413m3", nb1413m3_device, dipsw1_r)
// AM_RANGE(0xf1, 0xf1) AM_DEVREAD("nb1413m3", nb1413m3_device, dipsw2_r)
@@ -345,7 +346,7 @@ static ADDRESS_MAP_START( mjsikaku_io_map, AS_IO, 8, nbmj8688_state )
AM_RANGE(0xa0, 0xa0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, inputport1_r, inputportsel_w)
AM_RANGE(0xb0, 0xb0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, inputport2_r, sndrombank1_w)
AM_RANGE(0xd0, 0xd0) AM_READ(ff_r) // irq ack? watchdog?
- AM_RANGE(0xd0, 0xd0) AM_DEVWRITE("dac", dac_device, write_unsigned8)
+ AM_RANGE(0xd0, 0xd0) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(0xe0, 0xe0) AM_WRITE(mjsikaku_gfxflag2_w)
AM_RANGE(0xf0, 0xf0) AM_DEVREAD("nb1413m3", nb1413m3_device, dipsw1_r)
AM_RANGE(0xf1, 0xf1) AM_DEVREAD("nb1413m3", nb1413m3_device, dipsw2_r)
@@ -367,7 +368,7 @@ static ADDRESS_MAP_START( mmsikaku_io_map, AS_IO, 8, nbmj8688_state )
AM_RANGE(0xa0, 0xa0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, inputport1_r, inputportsel_w)
AM_RANGE(0xb0, 0xb0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, inputport2_r, sndrombank1_w)
AM_RANGE(0xd0, 0xd0) AM_READ(ff_r) // irq ack? watchdog?
- AM_RANGE(0xd0, 0xd0) AM_DEVWRITE("dac", dac_device, write_unsigned8)
+ AM_RANGE(0xd0, 0xd0) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(0xe0, 0xe0) AM_WRITE(mjsikaku_gfxflag2_w)
// AM_RANGE(0xf0, 0xf0) AM_DEVREAD("nb1413m3", nb1413m3_device, dipsw1_r)
// AM_RANGE(0xf1, 0xf1) AM_DEVREAD("nb1413m3", nb1413m3_device, dipsw2_r)
@@ -2468,15 +2469,16 @@ static MACHINE_CONFIG_START( NBMJDRV_4096, nbmj8688_state )
MCFG_VIDEO_START_OVERRIDE(nbmj8688_state,mbmj8688_pure_12bit)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_SOUND_ADD("psg", AY8910, 1250000)
MCFG_AY8910_PORT_A_READ_CB(READ8(nbmj8688_state, dipsw1_r)) // DIPSW-A read
MCFG_AY8910_PORT_B_READ_CB(READ8(nbmj8688_state, dipsw2_r)) // DIPSW-B read
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.35)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.35)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( NBMJDRV_256, NBMJDRV_4096 )
@@ -2580,9 +2582,10 @@ static MACHINE_CONFIG_DERIVED( barline, mbmj_h12bit )
MCFG_NB1413M3_TYPE( NB1413M3_BARLINE )
MCFG_SOUND_REPLACE("psg", YM3812, 20000000/8)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.35)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.35)
MCFG_DEVICE_REMOVE("dac")
+ MCFG_DEVICE_REMOVE("vref")
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( mbmj_p16bit, NBMJDRV_65536 )
@@ -2647,15 +2650,16 @@ static MACHINE_CONFIG_START( mbmj_p16bit_LCD, nbmj8688_state )
MCFG_VIDEO_START_OVERRIDE(nbmj8688_state,mbmj8688_pure_16bit_LCD)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_SOUND_ADD("psg", AY8910, 1250000)
MCFG_AY8910_PORT_A_READ_CB(READ8(nbmj8688_state, dipsw1_r)) // DIPSW-A read
MCFG_AY8910_PORT_B_READ_CB(READ8(nbmj8688_state, dipsw2_r)) // DIPSW-B read
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.35)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.35)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( bijokkoy, mbmj_p16bit_LCD )
@@ -2844,7 +2848,7 @@ static MACHINE_CONFIG_DERIVED( mjsikaku, NBMJDRV_4096 )
/* sound hardware */
MCFG_SOUND_REPLACE("psg", YM3812, 20000000/8)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.70)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.7)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( mmsikaku, NBMJDRV_4096 )
diff --git a/src/mame/drivers/nbmj8891.cpp b/src/mame/drivers/nbmj8891.cpp
index 13415b1ad8d..64966bd50b3 100644
--- a/src/mame/drivers/nbmj8891.cpp
+++ b/src/mame/drivers/nbmj8891.cpp
@@ -41,12 +41,13 @@ TODO:
******************************************************************************/
#include "emu.h"
-#include "cpu/z80/z80.h"
-#include "sound/dac.h"
-#include "sound/ay8910.h"
-#include "sound/3812intf.h"
#include "includes/nbmj8891.h"
+#include "cpu/z80/z80.h"
#include "machine/nvram.h"
+#include "sound/3812intf.h"
+#include "sound/ay8910.h"
+#include "sound/dac.h"
+#include "sound/volt_reg.h"
DRIVER_INIT_MEMBER(nbmj8891_state,gionbana)
@@ -346,7 +347,7 @@ static ADDRESS_MAP_START( gionbana_io_map, AS_IO, 8, nbmj8891_state )
AM_RANGE(0xa0, 0xa0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, inputport1_r, inputportsel_w)
AM_RANGE(0xb0, 0xb0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, inputport2_r, sndrombank1_w)
AM_RANGE(0xc0, 0xc0) AM_DEVREAD("nb1413m3", nb1413m3_device, inputport3_r) //AM_WRITENOP
- AM_RANGE(0xd0, 0xd0) AM_DEVWRITE("dac", dac_device, write_unsigned8)
+ AM_RANGE(0xd0, 0xd0) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(0xe0, 0xe0) AM_WRITE(vramsel_w)
AM_RANGE(0xf0, 0xf0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, dipsw1_r, outcoin_w)
AM_RANGE(0xf1, 0xf1) AM_DEVREAD("nb1413m3", nb1413m3_device, dipsw2_r)
@@ -365,7 +366,7 @@ static ADDRESS_MAP_START( mgion_io_map, AS_IO, 8, nbmj8891_state )
AM_RANGE(0xa0, 0xa0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, inputport1_r, inputportsel_w)
AM_RANGE(0xb0, 0xb0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, inputport2_r, sndrombank1_w)
AM_RANGE(0xc0, 0xc0) AM_DEVREAD("nb1413m3", nb1413m3_device, inputport3_r) //AM_WRITENOP
- AM_RANGE(0xd0, 0xd0) AM_DEVWRITE("dac", dac_device, write_unsigned8)
+ AM_RANGE(0xd0, 0xd0) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(0xe0, 0xe0) AM_WRITE(vramsel_w)
AM_RANGE(0xf0, 0xf0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, dipsw1_r, outcoin_w)
AM_RANGE(0xf1, 0xf1) AM_DEVREAD("nb1413m3", nb1413m3_device, dipsw2_r)
@@ -388,7 +389,7 @@ static ADDRESS_MAP_START( omotesnd_io_map, AS_IO, 8, nbmj8891_state )
AM_RANGE(0xb0, 0xb0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, inputport2_r, sndrombank1_w)
AM_RANGE(0xc0, 0xc0) AM_DEVREAD("nb1413m3", nb1413m3_device, inputport3_r) AM_WRITENOP
AM_RANGE(0xd0, 0xdf) AM_READ(clut_r)
- AM_RANGE(0xd0, 0xd0) AM_DEVWRITE("dac", dac_device, write_unsigned8)
+ AM_RANGE(0xd0, 0xd0) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(0xf0, 0xf0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, dipsw1_r, outcoin_w)
AM_RANGE(0xf1, 0xf1) AM_DEVREAD("nb1413m3", nb1413m3_device, dipsw2_r)
ADDRESS_MAP_END
@@ -406,7 +407,7 @@ static ADDRESS_MAP_START( hanamomo_io_map, AS_IO, 8, nbmj8891_state )
AM_RANGE(0xa0, 0xa0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, inputport1_r, inputportsel_w)
AM_RANGE(0xb0, 0xb0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, inputport2_r, sndrombank1_w)
AM_RANGE(0xc0, 0xc0) AM_DEVREAD("nb1413m3", nb1413m3_device, inputport3_r) //AM_WRITENOP
- AM_RANGE(0xd0, 0xd0) AM_DEVWRITE("dac", dac_device, write_unsigned8)
+ AM_RANGE(0xd0, 0xd0) AM_DEVWRITE("dac", dac_byte_interface, write)
// AM_RANGE(0xe0, 0xe0) AM_WRITENOP
AM_RANGE(0xf0, 0xf0) AM_DEVREAD("nb1413m3", nb1413m3_device, dipsw1_r) //AM_WRITENOP
AM_RANGE(0xf1, 0xf1) AM_DEVREAD("nb1413m3", nb1413m3_device, dipsw2_r)
@@ -425,7 +426,7 @@ static ADDRESS_MAP_START( msjiken_io_map, AS_IO, 8, nbmj8891_state )
AM_RANGE(0xa0, 0xa0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, inputport1_r, inputportsel_w)
AM_RANGE(0xb0, 0xb0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, inputport2_r, sndrombank1_w)
AM_RANGE(0xc0, 0xc0) AM_DEVREAD("nb1413m3", nb1413m3_device, inputport3_r) //AM_WRITENOP
- AM_RANGE(0xd0, 0xd0) AM_DEVWRITE("dac", dac_device, write_unsigned8)
+ AM_RANGE(0xd0, 0xd0) AM_DEVWRITE("dac", dac_byte_interface, write)
// AM_RANGE(0xe0, 0xe0) AM_WRITENOP
AM_RANGE(0xf0, 0xf0) AM_DEVREAD("nb1413m3", nb1413m3_device, dipsw1_r) //AM_WRITENOP
AM_RANGE(0xf1, 0xf1) AM_DEVREAD("nb1413m3", nb1413m3_device, dipsw2_r)
@@ -444,7 +445,7 @@ static ADDRESS_MAP_START( scandal_io_map, AS_IO, 8, nbmj8891_state )
AM_RANGE(0xa0, 0xa0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, inputport1_r, inputportsel_w)
AM_RANGE(0xb0, 0xb0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, inputport2_r, sndrombank1_w)
AM_RANGE(0xc0, 0xc0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, inputport3_r, nmi_clock_w)
- AM_RANGE(0xd0, 0xd0) AM_DEVWRITE("dac", dac_device, write_unsigned8)
+ AM_RANGE(0xd0, 0xd0) AM_DEVWRITE("dac", dac_byte_interface, write)
// AM_RANGE(0xe0, 0xe0) AM_WRITENOP
AM_RANGE(0xf0, 0xf0) AM_DEVREAD("nb1413m3", nb1413m3_device, dipsw1_r) //AM_WRITENOP
AM_RANGE(0xf1, 0xf1) AM_DEVREAD("nb1413m3", nb1413m3_device, dipsw2_r)
@@ -464,7 +465,7 @@ static ADDRESS_MAP_START( scandalm_io_map, AS_IO, 8, nbmj8891_state )
AM_RANGE(0xa0, 0xa0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, inputport1_r, inputportsel_w)
AM_RANGE(0xb0, 0xb0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, inputport2_r, sndrombank1_w)
AM_RANGE(0xc0, 0xc0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, inputport3_r, nmi_clock_w)
- AM_RANGE(0xd0, 0xd0) AM_DEVWRITE("dac", dac_device, write_unsigned8)
+ AM_RANGE(0xd0, 0xd0) AM_DEVWRITE("dac", dac_byte_interface, write)
// AM_RANGE(0xe0, 0xe0) AM_WRITENOP
AM_RANGE(0xf0, 0xf0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, dipsw1_r, outcoin_w)
AM_RANGE(0xf1, 0xf1) AM_DEVREAD("nb1413m3", nb1413m3_device, dipsw2_r)
@@ -484,7 +485,7 @@ static ADDRESS_MAP_START( bananadr_io_map, AS_IO, 8, nbmj8891_state )
AM_RANGE(0xa0, 0xa0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, inputport1_r, inputportsel_w)
AM_RANGE(0xb0, 0xb0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, inputport2_r, sndrombank1_w)
AM_RANGE(0xc0, 0xc0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, inputport3_r, nmi_clock_w)
- AM_RANGE(0xd0, 0xd0) AM_DEVWRITE("dac", dac_device, write_unsigned8)
+ AM_RANGE(0xd0, 0xd0) AM_DEVWRITE("dac", dac_byte_interface, write)
// AM_RANGE(0xe0, 0xe0) AM_WRITENOP
AM_RANGE(0xf0, 0xf0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, dipsw1_r, outcoin_w)
AM_RANGE(0xf1, 0xf1) AM_DEVREAD("nb1413m3", nb1413m3_device, dipsw2_r)
@@ -503,7 +504,7 @@ static ADDRESS_MAP_START( lovehous_io_map, AS_IO, 8, nbmj8891_state )
AM_RANGE(0xa0, 0xa0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, inputport1_r, inputportsel_w)
AM_RANGE(0xb0, 0xb0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, inputport2_r, sndrombank1_w)
AM_RANGE(0xc0, 0xc0) AM_READ_PORT("PORT0-2")
- AM_RANGE(0xd0, 0xd0) AM_DEVWRITE("dac", dac_device, write_unsigned8)
+ AM_RANGE(0xd0, 0xd0) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(0xe0, 0xe0) AM_WRITE(vramsel_w)
AM_RANGE(0xf0, 0xf0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, dipsw1_r, outcoin_w)
AM_RANGE(0xf1, 0xf1) AM_DEVREAD("nb1413m3", nb1413m3_device, dipsw2_r)
@@ -522,7 +523,7 @@ static ADDRESS_MAP_START( maiko_io_map, AS_IO, 8, nbmj8891_state )
AM_RANGE(0xa0, 0xa0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, inputport1_r, inputportsel_w)
AM_RANGE(0xb0, 0xb0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, inputport2_r, sndrombank1_w)
AM_RANGE(0xc0, 0xc0) AM_READ_PORT("PORT0-2") //AM_WRITENOP
- AM_RANGE(0xd0, 0xd0) AM_DEVWRITE("dac", dac_device, write_unsigned8)
+ AM_RANGE(0xd0, 0xd0) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(0xe0, 0xe0) AM_WRITE(vramsel_w)
AM_RANGE(0xf0, 0xf0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, dipsw1_r, outcoin_w)
AM_RANGE(0xf1, 0xf1) AM_DEVREAD("nb1413m3", nb1413m3_device, dipsw2_r)
@@ -538,7 +539,7 @@ static ADDRESS_MAP_START( taiwanmb_io_map, AS_IO, 8, nbmj8891_state )
AM_RANGE(0xb0, 0xb0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, inputport2_r, sndrombank1_w)
// AM_RANGE(0xc0, 0xc0) AM_WRITENOP // ?
// AM_RANGE(0xd0, 0xd0) AM_READ(ff_r) // irq ack? watchdog?
- AM_RANGE(0xd0, 0xd0) AM_DEVWRITE("dac", dac_device, write_unsigned8)
+ AM_RANGE(0xd0, 0xd0) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(0xe0, 0xe0) AM_DEVREAD("nb1413m3", nb1413m3_device, dipsw3_h_r) AM_WRITE(taiwanmb_gfxdraw_w) // blitter draw start
AM_RANGE(0xe1, 0xe1) AM_DEVREAD("nb1413m3", nb1413m3_device, dipsw3_l_r)
AM_RANGE(0xf0, 0xf0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, dipsw2_r, outcoin_w)
@@ -2287,13 +2288,14 @@ static MACHINE_CONFIG_START( gionbana, nbmj8891_state )
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_SOUND_ADD("fmsnd", YM3812, 2500000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.37) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( mgion, gionbana )
@@ -2325,7 +2327,7 @@ static MACHINE_CONFIG_DERIVED( omotesnd, gionbana )
MCFG_SOUND_REPLACE("fmsnd", AY8910, 1250000)
MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSWA"))
MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSWB"))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.35)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.35)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( abunai, gionbana )
@@ -2576,7 +2578,7 @@ static MACHINE_CONFIG_DERIVED( mjfocusm, gionbana )
MCFG_SOUND_REPLACE("fmsnd", AY8910, 1250000)
MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSWA"))
MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSWB"))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.70)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.7)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( scandalm, mjfocusm )
@@ -2607,7 +2609,7 @@ static MACHINE_CONFIG_DERIVED( taiwanmb, gionbana )
MCFG_SOUND_REPLACE("fmsnd", AY8910, 1250000)
MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSWA"))
MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSWB"))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.70)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.7)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/nbmj8900.cpp b/src/mame/drivers/nbmj8900.cpp
index ff345a57045..b35348273a7 100644
--- a/src/mame/drivers/nbmj8900.cpp
+++ b/src/mame/drivers/nbmj8900.cpp
@@ -26,11 +26,11 @@ TODO:
******************************************************************************/
#include "emu.h"
+#include "includes/nbmj8900.h"
#include "cpu/z80/z80.h"
-#include "sound/dac.h"
-#include "sound/ay8910.h"
#include "sound/3812intf.h"
-#include "includes/nbmj8900.h"
+#include "sound/dac.h"
+#include "sound/volt_reg.h"
DRIVER_INIT_MEMBER(nbmj8900_state,ohpaipee)
@@ -122,7 +122,7 @@ static ADDRESS_MAP_START( ohpaipee_io_map, AS_IO, 8, nbmj8900_state )
AM_RANGE(0xa0, 0xa0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, inputport1_r, inputportsel_w)
AM_RANGE(0xb0, 0xb0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, inputport2_r, sndrombank1_w)
AM_RANGE(0xc0, 0xc0) AM_DEVREAD("nb1413m3", nb1413m3_device, inputport3_r)
- AM_RANGE(0xd0, 0xd0) AM_DEVWRITE("dac", dac_device, write_unsigned8)
+ AM_RANGE(0xd0, 0xd0) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(0xe0, 0xe0) AM_WRITE(vramsel_w)
AM_RANGE(0xf0, 0xf0) AM_DEVREAD("nb1413m3", nb1413m3_device, dipsw1_r)
AM_RANGE(0xf1, 0xf1) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, dipsw2_r, outcoin_w)
@@ -323,13 +323,14 @@ static MACHINE_CONFIG_START( ohpaipee, nbmj8900_state )
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_SOUND_ADD("ymsnd", YM3812, 2500000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.70)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.7)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.85)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.42) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( togenkyo, ohpaipee )
diff --git a/src/mame/drivers/nbmj8991.cpp b/src/mame/drivers/nbmj8991.cpp
index bd37c58545e..9b8e578432f 100644
--- a/src/mame/drivers/nbmj8991.cpp
+++ b/src/mame/drivers/nbmj8991.cpp
@@ -31,12 +31,13 @@ Notes:
******************************************************************************/
#include "emu.h"
+#include "includes/nbmj8991.h"
#include "cpu/z80/z80.h"
-#include "sound/ay8910.h"
+#include "machine/nvram.h"
#include "sound/3812intf.h"
+#include "sound/ay8910.h"
#include "sound/dac.h"
-#include "includes/nbmj8991.h"
-#include "machine/nvram.h"
+#include "sound/volt_reg.h"
WRITE8_MEMBER(nbmj8991_state::soundbank_w)
@@ -164,7 +165,7 @@ static ADDRESS_MAP_START( galkoku_io_map, AS_IO, 8, nbmj8991_state )
AM_RANGE(0xa0, 0xa0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, inputport1_r, inputportsel_w)
AM_RANGE(0xb0, 0xb0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, inputport2_r, sndrombank1_w)
AM_RANGE(0xc0, 0xc0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, inputport3_r, nmi_clock_w)
- AM_RANGE(0xd0, 0xd0) AM_DEVWRITE("dac", dac_device, write_unsigned8)
+ AM_RANGE(0xd0, 0xd0) AM_DEVWRITE("dac", dac_byte_interface, write)
// AM_RANGE(0xe0, 0xe0) AM_WRITENOP
AM_RANGE(0xf0, 0xf0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, dipsw1_r, outcoin_w)
AM_RANGE(0xf1, 0xf1) AM_DEVREAD("nb1413m3", nb1413m3_device, dipsw2_r)
@@ -179,7 +180,7 @@ static ADDRESS_MAP_START( hyouban_io_map, AS_IO, 8, nbmj8991_state )
AM_RANGE(0xa0, 0xa0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, inputport1_r, inputportsel_w)
AM_RANGE(0xb0, 0xb0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, inputport2_r, sndrombank1_w)
AM_RANGE(0xc0, 0xc0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, inputport3_r, nmi_clock_w)
- AM_RANGE(0xd0, 0xd0) AM_DEVWRITE("dac", dac_device, write_unsigned8)
+ AM_RANGE(0xd0, 0xd0) AM_DEVWRITE("dac", dac_byte_interface, write)
// AM_RANGE(0xe0, 0xe0) AM_WRITENOP
AM_RANGE(0xf0, 0xf0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, dipsw1_r, outcoin_w)
AM_RANGE(0xf1, 0xf1) AM_DEVREAD("nb1413m3", nb1413m3_device, dipsw2_r)
@@ -221,8 +222,8 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( nbmj8991_sound_io_map, AS_IO, 8, nbmj8991_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x00, 0x00) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_DEVWRITE("dac1", dac_device, write_unsigned8)
- AM_RANGE(0x02, 0x02) AM_DEVWRITE("dac2", dac_device, write_unsigned8)
+ AM_RANGE(0x00, 0x00) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_DEVWRITE("dac1", dac_byte_interface, write)
+ AM_RANGE(0x02, 0x02) AM_DEVWRITE("dac2", dac_byte_interface, write)
AM_RANGE(0x04, 0x04) AM_WRITE(soundbank_w)
AM_RANGE(0x06, 0x06) AM_WRITENOP
AM_RANGE(0x80, 0x81) AM_DEVWRITE("fmsnd", ym3812_device, write)
@@ -1349,12 +1350,13 @@ static MACHINE_CONFIG_START( nbmjdrv1, nbmj8991_state ) // galkoku
MCFG_PALETTE_ADD("palette", 256)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_SOUND_ADD("fmsnd", YM3812, 25000000/10)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.70)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.7)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
@@ -1385,18 +1387,18 @@ static MACHINE_CONFIG_START( nbmjdrv2, nbmj8991_state ) // pstadium
MCFG_PALETTE_ADD("palette", 256)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("fmsnd", YM3812, 25000000/6.25)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.70)
-
- MCFG_DAC_ADD("dac1")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.7)
- MCFG_DAC_ADD("dac2")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ADD("dac1", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) // unknown DAC
+ MCFG_SOUND_ADD("dac2", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac1", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac1", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac2", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac2", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
@@ -1408,7 +1410,7 @@ static MACHINE_CONFIG_DERIVED( nbmjdrv3, nbmjdrv1 )
MCFG_SOUND_REPLACE("fmsnd", AY8910, 1250000)
MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSWA"))
MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSWB"))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.35)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.35)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/nbmj9195.cpp b/src/mame/drivers/nbmj9195.cpp
index b6e1371fda5..46decf5721d 100644
--- a/src/mame/drivers/nbmj9195.cpp
+++ b/src/mame/drivers/nbmj9195.cpp
@@ -22,12 +22,13 @@ Notes:
******************************************************************************/
#include "emu.h"
-#include "machine/nvram.h"
+#include "includes/nbmj9195.h"
#include "includes/nb1413m3.h" // needed for mahjong input controller
#include "machine/gen_latch.h"
+#include "machine/nvram.h"
#include "sound/3812intf.h"
#include "sound/dac.h"
-#include "includes/nbmj9195.h"
+#include "sound/volt_reg.h"
void nbmj9195_state::machine_start()
@@ -2554,22 +2555,6 @@ static const z80_daisy_config daisy_chain_sound[] =
{ nullptr }
};
-
-// the only difference between these 2 setups is the DAC is swapped, is that intentional?
-#define OTHERS_TMZ84C011_SOUND_PORTS \
- MCFG_TMPZ84C011_PORTA_WRITE_CB(WRITE8(nbmj9195_state, soundbank_w)) \
- MCFG_TMPZ84C011_PORTB_WRITE_CB(DEVWRITE8("dac1", dac_device, write_unsigned8)) \
- MCFG_TMPZ84C011_PORTC_WRITE_CB(DEVWRITE8("dac2", dac_device, write_unsigned8)) \
- MCFG_TMPZ84C011_PORTD_READ_CB(DEVREAD8("soundlatch", generic_latch_8_device, read)) \
- MCFG_TMPZ84C011_PORTE_WRITE_CB(WRITE8(nbmj9195_state, soundcpu_porte_w))
-#define MSCOUTM_TMZ84C011_SOUND_PORTS \
- MCFG_TMPZ84C011_PORTA_WRITE_CB(WRITE8(nbmj9195_state, soundbank_w)) \
- MCFG_TMPZ84C011_PORTB_WRITE_CB(DEVWRITE8("dac2", dac_device, write_unsigned8)) \
- MCFG_TMPZ84C011_PORTC_WRITE_CB(DEVWRITE8("dac1", dac_device, write_unsigned8)) \
- MCFG_TMPZ84C011_PORTD_READ_CB(DEVREAD8("soundlatch", generic_latch_8_device, read)) \
- MCFG_TMPZ84C011_PORTE_WRITE_CB(WRITE8(nbmj9195_state, soundcpu_porte_w))
-
-
#define MSCOUTM_TMZ84C011_MAIN_PORTS \
MCFG_TMPZ84C011_PORTA_READ_CB(IOPORT("SYSTEM")) \
MCFG_TMPZ84C011_PORTA_WRITE_CB(WRITE8(nbmj9195_state, mscoutm_inputportsel_w)) \
@@ -2600,6 +2585,11 @@ static MACHINE_CONFIG_START( NBMJDRV1_base, nbmj9195_state )
MCFG_CPU_PROGRAM_MAP(sailorws_sound_map)
MCFG_CPU_IO_MAP(sailorws_sound_io_map)
MCFG_TMPZ84C011_ZC0_CB(DEVWRITELINE("audiocpu", tmpz84c011_device, trg3))
+ MCFG_TMPZ84C011_PORTA_WRITE_CB(WRITE8(nbmj9195_state, soundbank_w)) \
+ MCFG_TMPZ84C011_PORTB_WRITE_CB(DEVWRITE8("dac1", dac_byte_interface, write)) \
+ MCFG_TMPZ84C011_PORTC_WRITE_CB(DEVWRITE8("dac2", dac_byte_interface, write)) \
+ MCFG_TMPZ84C011_PORTD_READ_CB(DEVREAD8("soundlatch", generic_latch_8_device, read)) \
+ MCFG_TMPZ84C011_PORTE_WRITE_CB(WRITE8(nbmj9195_state, soundcpu_porte_w))
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -2613,18 +2603,18 @@ static MACHINE_CONFIG_START( NBMJDRV1_base, nbmj9195_state )
MCFG_PALETTE_ADD("palette", 256)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("ymsnd", YM3812, 4000000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.70)
-
- MCFG_DAC_ADD("dac1")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.7)
- MCFG_DAC_ADD("dac2")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ADD("dac1", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) // unknown DAC
+ MCFG_SOUND_ADD("dac2", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac1", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac1", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac2", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac2", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( NBMJDRV1, NBMJDRV1_base )
@@ -2632,9 +2622,6 @@ static MACHINE_CONFIG_DERIVED( NBMJDRV1, NBMJDRV1_base )
/* basic machine hardware */
MCFG_CPU_MODIFY("maincpu")
OTHERS_TMZ84C011_MAIN_PORTS
-
- MCFG_CPU_MODIFY("audiocpu")
- OTHERS_TMZ84C011_SOUND_PORTS
MACHINE_CONFIG_END
@@ -2644,9 +2631,6 @@ static MACHINE_CONFIG_DERIVED( NBMJDRV2, NBMJDRV1_base )
MCFG_CPU_MODIFY("maincpu")
OTHERS_TMZ84C011_MAIN_PORTS
- MCFG_CPU_MODIFY("audiocpu")
- OTHERS_TMZ84C011_SOUND_PORTS
-
/* video hardware */
MCFG_VIDEO_START_OVERRIDE(nbmj9195_state,_1layer)
MACHINE_CONFIG_END
@@ -2658,9 +2642,6 @@ static MACHINE_CONFIG_DERIVED( NBMJDRV3, NBMJDRV1_base )
MCFG_CPU_MODIFY("maincpu")
MSCOUTM_TMZ84C011_MAIN_PORTS
- MCFG_CPU_MODIFY("audiocpu")
- MSCOUTM_TMZ84C011_SOUND_PORTS
-
/* video hardware */
MCFG_PALETTE_MODIFY("palette")
MCFG_PALETTE_ENTRIES(512)
diff --git a/src/mame/drivers/ngp.cpp b/src/mame/drivers/ngp.cpp
index 639c980d3bc..1729789d8f6 100644
--- a/src/mame/drivers/ngp.cpp
+++ b/src/mame/drivers/ngp.cpp
@@ -98,17 +98,17 @@ the Neogeo Pocket.
#include "emu.h"
+#include "bus/generic/slot.h"
+#include "bus/generic/carts.h"
#include "cpu/tlcs900/tlcs900.h"
#include "cpu/z80/z80.h"
#include "sound/t6w28.h"
#include "sound/dac.h"
+#include "sound/volt_reg.h"
#include "video/k1ge.h"
#include "rendlay.h"
#include "softlist.h"
-#include "bus/generic/slot.h"
-#include "bus/generic/carts.h"
-
enum flash_state
{
F_READ, /* xxxx F0 or 5555 AA 2AAA 55 5555 F0 */
@@ -132,8 +132,8 @@ public:
m_tlcs900(*this, "maincpu"),
m_z80(*this, "soundcpu"),
m_t6w28(*this, "t6w28"),
- m_dac_l(*this, "dac_l"),
- m_dac_r(*this, "dac_r"),
+ m_ldac(*this, "ldac"),
+ m_rdac(*this, "rdac"),
m_cart(*this, "cartslot"),
m_mainram(*this, "mainram"),
m_k1ge(*this, "k1ge"),
@@ -172,8 +172,8 @@ public:
required_device<cpu_device> m_tlcs900;
required_device<cpu_device> m_z80;
required_device<t6w28_device> m_t6w28;
- required_device<dac_device> m_dac_l;
- required_device<dac_device> m_dac_r;
+ required_device<dac_byte_interface> m_ldac;
+ required_device<dac_byte_interface> m_rdac;
required_device<generic_slot_device> m_cart;
required_shared_ptr<UINT8> m_mainram;
required_device<k1ge_device> m_k1ge;
@@ -278,10 +278,10 @@ WRITE8_MEMBER( ngp_state::ngp_io_w )
break;
case 0x22: /* DAC right */
- m_dac_r->write_unsigned8(data );
+ m_rdac->write(data);
break;
case 0x23: /* DAC left */
- m_dac_l->write_unsigned8(data );
+ m_ldac->write(data);
break;
/* Internal eeprom related? */
@@ -838,10 +838,11 @@ static MACHINE_CONFIG_START( ngp_common, ngp_state )
MCFG_SOUND_ROUTE( 0, "lspeaker", 0.50 )
MCFG_SOUND_ROUTE( 1, "rspeaker", 0.50 )
- MCFG_SOUND_ADD( "dac_l", DAC, 0 )
- MCFG_SOUND_ROUTE( ALL_OUTPUTS, "lspeaker", 0.50 )
- MCFG_SOUND_ADD( "dac_r", DAC, 0 )
- MCFG_SOUND_ROUTE( ALL_OUTPUTS, "rspeaker", 0.50 )
+ MCFG_SOUND_ADD("ldac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.25) // unknown DAC
+ MCFG_SOUND_ADD("rdac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.25) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "ldac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "ldac", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "rdac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "rdac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/niyanpai.cpp b/src/mame/drivers/niyanpai.cpp
index e7fe3060169..553939db652 100644
--- a/src/mame/drivers/niyanpai.cpp
+++ b/src/mame/drivers/niyanpai.cpp
@@ -36,14 +36,15 @@ Memo:
******************************************************************************/
#include "emu.h"
+#include "includes/niyanpai.h"
+#include "includes/nb1413m3.h"
#include "cpu/z80/tmpz84c011.h"
#include "cpu/m68000/m68000.h"
+#include "machine/nvram.h"
#include "machine/tmp68301.h"
-#include "includes/nb1413m3.h"
-#include "sound/dac.h"
#include "sound/3812intf.h"
-#include "machine/nvram.h"
-#include "includes/niyanpai.h"
+#include "sound/dac.h"
+#include "sound/volt_reg.h"
WRITE8_MEMBER(niyanpai_state::soundbank_w)
@@ -732,8 +733,8 @@ static MACHINE_CONFIG_START( niyanpai, niyanpai_state )
MCFG_CPU_IO_MAP(niyanpai_sound_io_map)
MCFG_TMPZ84C011_PORTD_READ_CB(DEVREAD8("soundlatch", generic_latch_8_device, read))
MCFG_TMPZ84C011_PORTA_WRITE_CB(WRITE8(niyanpai_state, soundbank_w))
- MCFG_TMPZ84C011_PORTB_WRITE_CB(DEVWRITE8("dac1", dac_device, write_unsigned8))
- MCFG_TMPZ84C011_PORTC_WRITE_CB(DEVWRITE8("dac2", dac_device, write_unsigned8))
+ MCFG_TMPZ84C011_PORTB_WRITE_CB(DEVWRITE8("dac1", dac_byte_interface, write))
+ MCFG_TMPZ84C011_PORTC_WRITE_CB(DEVWRITE8("dac2", dac_byte_interface, write))
MCFG_TMPZ84C011_PORTE_WRITE_CB(WRITE8(niyanpai_state, soundlatch_clear_w))
MCFG_TMPZ84C011_ZC0_CB(DEVWRITELINE("audiocpu", tmpz84c011_device, trg3))
@@ -751,18 +752,18 @@ static MACHINE_CONFIG_START( niyanpai, niyanpai_state )
MCFG_PALETTE_ADD("palette", 256*3)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("ymsnd", YM3812, 4000000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
-
- MCFG_DAC_ADD("dac1")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
- MCFG_DAC_ADD("dac2")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
+ MCFG_SOUND_ADD("dac1", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.37) // unknown DAC
+ MCFG_SOUND_ADD("dac2", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.37) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac1", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac1", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac2", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac2", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( musobana, niyanpai )
diff --git a/src/mame/drivers/notetaker.cpp b/src/mame/drivers/notetaker.cpp
index 9a3ab8e7a62..5c637919ca7 100644
--- a/src/mame/drivers/notetaker.cpp
+++ b/src/mame/drivers/notetaker.cpp
@@ -76,11 +76,12 @@ DONE:
*/
#include "cpu/i86/i86.h"
-#include "machine/pic8259.h"
#include "machine/ay31015.h"
-#include "video/tms9927.h"
-#include "sound/dac.h"
+#include "machine/pic8259.h"
#include "machine/wd_fdc.h"
+#include "sound/dac.h"
+#include "sound/volt_reg.h"
+#include "video/tms9927.h"
class notetaker_state : public driver_device
{
@@ -109,7 +110,7 @@ public:
required_device<ay31015_device> m_kbduart;
required_device<ay31015_device> m_eiauart;
required_device<crt5027_device> m_crtc;
- required_device<dac_device> m_dac;
+ required_device<dac_word_interface> m_dac;
required_device<fd1791_t> m_fdc;
required_device<floppy_connector> m_floppy0;
floppy_image_device *m_floppy;
@@ -227,7 +228,7 @@ TIMER_CALLBACK_MEMBER(notetaker_state::timer_fifoclk)
m_outfifo_count--;
}
m_outfifo_tail_ptr&=0xF;
- m_dac->write_unsigned16(data);
+ m_dac->write(data);
m_FIFO_timer->adjust(attotime::from_hz(((XTAL_960kHz/10)/4)/((m_FrSel0<<3)+(m_FrSel1<<2)+(m_FrSel2<<1)+1))); // FIFO timer is clocked by 960khz divided by 10 (74ls162 decade counter), divided by 4 (mc14568B with divider 1 pins set to 4), divided by 1,3,5,7,9,11,13,15 (or 0,2,4,6,8,10,12,14?)
}
@@ -349,7 +350,7 @@ WRITE16_MEMBER(notetaker_state::FIFOBus_w)
#endif
return;
}
- m_outfifo[m_outfifo_head_ptr] = data;
+ m_outfifo[m_outfifo_head_ptr] = data >> 4;
m_outfifo_head_ptr++;
m_outfifo_count++;
m_outfifo_head_ptr&=0xF;
@@ -824,10 +825,11 @@ static MACHINE_CONFIG_START( notetakr, notetaker_state )
MCFG_FLOPPY_DRIVE_ADD("wd1791:0", notetaker_floppies, "525dd", floppy_image_device::default_floppy_formats)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono") // TODO: should be stereo
- MCFG_SOUND_ADD("dac", DAC, 0) /* DAC1200, set up with two sample and hold HA2425 chips outside it to do stereo */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
-
+ MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ // TODO: hook DAC up to two HA2425 (sample and hold) chips and hook those up to the speakers
+ MCFG_SOUND_ADD("dac", DAC1200, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.5) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.5) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
DRIVER_INIT_MEMBER(notetaker_state,notetakr)
diff --git a/src/mame/drivers/nycaptor.cpp b/src/mame/drivers/nycaptor.cpp
index d0baed92afe..2e5dbd7fb91 100644
--- a/src/mame/drivers/nycaptor.cpp
+++ b/src/mame/drivers/nycaptor.cpp
@@ -194,12 +194,13 @@ Stephh's additional notes (based on the game Z80 code and some tests) :
#include "emu.h"
+#include "includes/nycaptor.h"
#include "cpu/m6805/m6805.h"
#include "cpu/z80/z80.h"
-#include "includes/nycaptor.h"
#include "includes/taitoipt.h"
#include "sound/ay8910.h"
#include "sound/dac.h"
+#include "sound/volt_reg.h"
WRITE8_MEMBER(nycaptor_state::sub_cpu_halt_w)
@@ -454,7 +455,7 @@ static ADDRESS_MAP_START( cyclshtg_slave_map, AS_PROGRAM, 8, nycaptor_state )
ADDRESS_MAP_END
static ADDRESS_MAP_START( cyclshtg_sound_map, AS_PROGRAM, 8, nycaptor_state )
- AM_RANGE(0xd600, 0xd600) AM_DEVWRITE("dac", dac_device, write_signed8) //otherwise no girl's scream, see MT03975
+ AM_RANGE(0xd600, 0xd600) AM_DEVWRITE("dac", dac_byte_interface, write) //otherwise no girl's scream, see MT03975
AM_IMPORT_FROM( nycaptor_sound_map )
ADDRESS_MAP_END
@@ -835,33 +836,35 @@ static MACHINE_CONFIG_START( nycaptor, nycaptor_state )
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("ay1", AY8910, 8000000/4)
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(nycaptor_state, unk_w))
MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(nycaptor_state, unk_w))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.15)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.15)
MCFG_SOUND_ADD("ay2", AY8910, 8000000/4)
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(nycaptor_state, unk_w))
MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(nycaptor_state, unk_w))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.15)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.15)
MCFG_SOUND_ADD("msm", MSM5232, 2000000)
MCFG_MSM5232_SET_CAPACITORS(0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6) /* 0.65 (???) uF capacitors (match the sample, not verified) */
- MCFG_SOUND_ROUTE(0, "mono", 1.0) // pin 28 2'-1
- MCFG_SOUND_ROUTE(1, "mono", 1.0) // pin 29 4'-1
- MCFG_SOUND_ROUTE(2, "mono", 1.0) // pin 30 8'-1
- MCFG_SOUND_ROUTE(3, "mono", 1.0) // pin 31 16'-1
- MCFG_SOUND_ROUTE(4, "mono", 1.0) // pin 36 2'-2
- MCFG_SOUND_ROUTE(5, "mono", 1.0) // pin 35 4'-2
- MCFG_SOUND_ROUTE(6, "mono", 1.0) // pin 34 8'-2
- MCFG_SOUND_ROUTE(7, "mono", 1.0) // pin 33 16'-2
+ MCFG_SOUND_ROUTE(0, "speaker", 1.0) // pin 28 2'-1
+ MCFG_SOUND_ROUTE(1, "speaker", 1.0) // pin 29 4'-1
+ MCFG_SOUND_ROUTE(2, "speaker", 1.0) // pin 30 8'-1
+ MCFG_SOUND_ROUTE(3, "speaker", 1.0) // pin 31 16'-1
+ MCFG_SOUND_ROUTE(4, "speaker", 1.0) // pin 36 2'-2
+ MCFG_SOUND_ROUTE(5, "speaker", 1.0) // pin 35 4'-2
+ MCFG_SOUND_ROUTE(6, "speaker", 1.0) // pin 34 8'-2
+ MCFG_SOUND_ROUTE(7, "speaker", 1.0) // pin 33 16'-2
// pin 1 SOLO 8' not mapped
// pin 2 SOLO 16' not mapped
// pin 22 Noise Output not mapped
+
+ // Does the DAC also exist on this board? nycaptor writes 0x80 to 0xd600
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( cyclshtg, nycaptor_state )
@@ -898,36 +901,37 @@ static MACHINE_CONFIG_START( cyclshtg, nycaptor_state )
MCFG_PALETTE_FORMAT(xxxxBBBBGGGGRRRR)
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("ay1", AY8910, 8000000/4)
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(nycaptor_state, unk_w))
MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(nycaptor_state, unk_w))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.15)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.15)
MCFG_SOUND_ADD("ay2", AY8910, 8000000/4)
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(nycaptor_state, unk_w))
MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(nycaptor_state, unk_w))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.15)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.15)
MCFG_SOUND_ADD("msm", MSM5232, 2000000)
MCFG_MSM5232_SET_CAPACITORS(0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6) /* 0.65 (???) uF capacitors (match the sample, not verified) */
- MCFG_SOUND_ROUTE(0, "mono", 1.0) // pin 28 2'-1
- MCFG_SOUND_ROUTE(1, "mono", 1.0) // pin 29 4'-1
- MCFG_SOUND_ROUTE(2, "mono", 1.0) // pin 30 8'-1
- MCFG_SOUND_ROUTE(3, "mono", 1.0) // pin 31 16'-1
- MCFG_SOUND_ROUTE(4, "mono", 1.0) // pin 36 2'-2
- MCFG_SOUND_ROUTE(5, "mono", 1.0) // pin 35 4'-2
- MCFG_SOUND_ROUTE(6, "mono", 1.0) // pin 34 8'-2
- MCFG_SOUND_ROUTE(7, "mono", 1.0) // pin 33 16'-2
+ MCFG_SOUND_ROUTE(0, "speaker", 1.0) // pin 28 2'-1
+ MCFG_SOUND_ROUTE(1, "speaker", 1.0) // pin 29 4'-1
+ MCFG_SOUND_ROUTE(2, "speaker", 1.0) // pin 30 8'-1
+ MCFG_SOUND_ROUTE(3, "speaker", 1.0) // pin 31 16'-1
+ MCFG_SOUND_ROUTE(4, "speaker", 1.0) // pin 36 2'-2
+ MCFG_SOUND_ROUTE(5, "speaker", 1.0) // pin 35 4'-2
+ MCFG_SOUND_ROUTE(6, "speaker", 1.0) // pin 34 8'-2
+ MCFG_SOUND_ROUTE(7, "speaker", 1.0) // pin 33 16'-2
// pin 1 SOLO 8' not mapped
// pin 2 SOLO 16' not mapped
// pin 22 Noise Output not mapped
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
@@ -960,37 +964,37 @@ static MACHINE_CONFIG_START( bronx, nycaptor_state )
MCFG_PALETTE_ADD("palette", 512)
MCFG_PALETTE_FORMAT(xxxxBBBBGGGGRRRR)
-
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("ay1", AY8910, 8000000/4)
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(nycaptor_state, unk_w))
MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(nycaptor_state, unk_w))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.15)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.15)
MCFG_SOUND_ADD("ay2", AY8910, 8000000/4)
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(nycaptor_state, unk_w))
MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(nycaptor_state, unk_w))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.15)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.15)
MCFG_SOUND_ADD("msm", MSM5232, 2000000)
MCFG_MSM5232_SET_CAPACITORS(0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6) /* 0.65 (???) uF capacitors (match the sample, not verified) */
- MCFG_SOUND_ROUTE(0, "mono", 1.0) // pin 28 2'-1
- MCFG_SOUND_ROUTE(1, "mono", 1.0) // pin 29 4'-1
- MCFG_SOUND_ROUTE(2, "mono", 1.0) // pin 30 8'-1
- MCFG_SOUND_ROUTE(3, "mono", 1.0) // pin 31 16'-1
- MCFG_SOUND_ROUTE(4, "mono", 1.0) // pin 36 2'-2
- MCFG_SOUND_ROUTE(5, "mono", 1.0) // pin 35 4'-2
- MCFG_SOUND_ROUTE(6, "mono", 1.0) // pin 34 8'-2
- MCFG_SOUND_ROUTE(7, "mono", 1.0) // pin 33 16'-2
+ MCFG_SOUND_ROUTE(0, "speaker", 1.0) // pin 28 2'-1
+ MCFG_SOUND_ROUTE(1, "speaker", 1.0) // pin 29 4'-1
+ MCFG_SOUND_ROUTE(2, "speaker", 1.0) // pin 30 8'-1
+ MCFG_SOUND_ROUTE(3, "speaker", 1.0) // pin 31 16'-1
+ MCFG_SOUND_ROUTE(4, "speaker", 1.0) // pin 36 2'-2
+ MCFG_SOUND_ROUTE(5, "speaker", 1.0) // pin 35 4'-2
+ MCFG_SOUND_ROUTE(6, "speaker", 1.0) // pin 34 8'-2
+ MCFG_SOUND_ROUTE(7, "speaker", 1.0) // pin 33 16'-2
// pin 1 SOLO 8' not mapped
// pin 2 SOLO 16' not mapped
// pin 22 Noise Output not mapped
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/nyny.cpp b/src/mame/drivers/nyny.cpp
index 12d7a69d02e..b6dd5556216 100644
--- a/src/mame/drivers/nyny.cpp
+++ b/src/mame/drivers/nyny.cpp
@@ -64,16 +64,17 @@
***************************************************************************/
#include "emu.h"
-#include "machine/rescap.h"
-#include "machine/6821pia.h"
-#include "machine/74123.h"
-#include "video/mc6845.h"
#include "cpu/m6800/m6800.h"
#include "cpu/m6809/m6809.h"
-#include "sound/ay8910.h"
-#include "sound/dac.h"
+#include "machine/6821pia.h"
+#include "machine/74123.h"
#include "machine/gen_latch.h"
#include "machine/nvram.h"
+#include "machine/rescap.h"
+#include "sound/ay8910.h"
+#include "sound/dac.h"
+#include "sound/volt_reg.h"
+#include "video/mc6845.h"
#define MAIN_CPU_MASTER_CLOCK XTAL_11_2MHz
@@ -637,7 +638,7 @@ static MACHINE_CONFIG_START( nyny, nyny_state )
MCFG_PIA_IRQB_HANDLER(WRITELINE(nyny_state,main_cpu_irq))
/* audio hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
@@ -645,19 +646,20 @@ static MACHINE_CONFIG_START( nyny, nyny_state )
MCFG_SOUND_ADD("ay1", AY8910, AUDIO_CPU_1_CLOCK)
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(nyny_state, nyny_ay8910_37_port_a_w))
- MCFG_AY8910_PORT_B_WRITE_CB(DEVWRITE8("dac", dac_device, write_unsigned8))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_AY8910_PORT_B_WRITE_CB(DEVWRITE8("dac", dac_byte_interface, write))
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
MCFG_SOUND_ADD("ay2", AY8910, AUDIO_CPU_1_CLOCK)
MCFG_AY8910_PORT_A_READ_CB(IOPORT("SW2"))
MCFG_AY8910_PORT_B_READ_CB(IOPORT("SW1"))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
MCFG_SOUND_ADD("ay3", AY8910, AUDIO_CPU_2_CLOCK)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.03)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.03)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/othello.cpp b/src/mame/drivers/othello.cpp
index 06cf16dbce4..e438d905725 100644
--- a/src/mame/drivers/othello.cpp
+++ b/src/mame/drivers/othello.cpp
@@ -42,8 +42,9 @@ Limit for help/undo (matta):
#include "cpu/mcs48/mcs48.h"
#include "machine/gen_latch.h"
#include "machine/i8243.h"
-#include "sound/dac.h"
#include "sound/ay8910.h"
+#include "sound/dac.h"
+#include "sound/volt_reg.h"
#include "video/mc6845.h"
@@ -326,7 +327,7 @@ static ADDRESS_MAP_START( n7751_portmap, AS_IO, 8, othello_state )
AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_READ(n7751_t1_r)
AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_READ(n7751_command_r)
AM_RANGE(MCS48_PORT_BUS, MCS48_PORT_BUS) AM_READ(n7751_rom_r)
- AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_DEVWRITE("dac", dac_device, write_unsigned8)
+ AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_WRITE(n7751_p2_w)
AM_RANGE(MCS48_PORT_PROG, MCS48_PORT_PROG) AM_DEVWRITE("n7751_8243", i8243_device, i8243_prog_w)
ADDRESS_MAP_END
@@ -435,18 +436,19 @@ static MACHINE_CONFIG_START( othello, othello_state )
MCFG_MC6845_UPDATE_ROW_CB(othello_state, crtc_update_row)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("ay1", AY8910, 2000000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.15)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.15)
MCFG_SOUND_ADD("ay2", AY8910, 2000000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.15)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.15)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.60)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.3) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
ROM_START( othello )
diff --git a/src/mame/drivers/palm.cpp b/src/mame/drivers/palm.cpp
index f60d74674d2..ced463dbe00 100644
--- a/src/mame/drivers/palm.cpp
+++ b/src/mame/drivers/palm.cpp
@@ -16,6 +16,7 @@
#include "machine/mc68328.h"
#include "machine/ram.h"
#include "sound/dac.h"
+#include "sound/volt_reg.h"
#include "rendlay.h"
#define MC68328_TAG "dragonball"
@@ -27,7 +28,6 @@ public:
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_lsi(*this, MC68328_TAG),
- m_dac(*this, "dac"),
m_ram(*this, RAM_TAG),
m_io_penx(*this, "PENX"),
m_io_peny(*this, "PENY"),
@@ -36,14 +36,7 @@ public:
required_device<cpu_device> m_maincpu;
required_device<mc68328_device> m_lsi;
- required_device<dac_device> m_dac;
required_device<ram_device> m_ram;
- //DECLARE_WRITE8_MEMBER(palm_dac_transition);
- //DECLARE_WRITE8_MEMBER(palm_port_f_out);
- //DECLARE_READ8_MEMBER(palm_port_c_in);
- //DECLARE_READ8_MEMBER(palm_port_f_in);
- //DECLARE_WRITE16_MEMBER(palm_spim_out);
- //DECLARE_READ16_MEMBER(palm_spim_in);
UINT8 m_port_f_latch;
UINT16 m_spim_data;
virtual void machine_start() override;
@@ -55,7 +48,6 @@ public:
DECLARE_READ8_MEMBER(palm_port_f_in);
DECLARE_WRITE16_MEMBER(palm_spim_out);
DECLARE_READ16_MEMBER(palm_spim_in);
- DECLARE_WRITE8_MEMBER(palm_dac_transition);
DECLARE_WRITE_LINE_MEMBER(palm_spim_exchange);
DECLARE_PALETTE_INIT(palm);
@@ -170,16 +162,6 @@ ADDRESS_MAP_END
/***************************************************************************
- AUDIO HARDWARE
-***************************************************************************/
-
-WRITE8_MEMBER(palm_state::palm_dac_transition)
-{
- m_dac->write_unsigned8(0x7f * data );
-}
-
-
-/***************************************************************************
MACHINE DRIVERS
***************************************************************************/
@@ -206,16 +188,17 @@ static MACHINE_CONFIG_START( palm, palm_state )
MCFG_DEFAULT_LAYOUT(layout_lcd)
/* audio hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("dac", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT)
MCFG_DEVICE_ADD( MC68328_TAG, MC68328, 0 ) // lsi device
MCFG_MC68328_CPU("maincpu")
MCFG_MC68328_OUT_PORT_F_CB(WRITE8(palm_state, palm_port_f_out)) // Port F Output
MCFG_MC68328_IN_PORT_C_CB(READ8(palm_state, palm_port_c_in)) // Port C Input
MCFG_MC68328_IN_PORT_F_CB(READ8(palm_state, palm_port_f_in)) // Port F Input
- MCFG_MC68328_OUT_PWM_CB(WRITE8(palm_state, palm_dac_transition))
+ MCFG_MC68328_OUT_PWM_CB(DEVWRITELINE("dac", dac_bit_interface, write))
MCFG_MC68328_OUT_SPIM_CB(WRITE16(palm_state, palm_spim_out))
MCFG_MC68328_IN_SPIM_CB(READ16(palm_state, palm_spim_in))
MCFG_MC68328_SPIM_XCH_TRIGGER_CB(WRITELINE(palm_state, palm_spim_exchange))
diff --git a/src/mame/drivers/pandoras.cpp b/src/mame/drivers/pandoras.cpp
index aa7f68bb076..f6d0ad273d9 100644
--- a/src/mame/drivers/pandoras.cpp
+++ b/src/mame/drivers/pandoras.cpp
@@ -24,15 +24,16 @@ Boards:
***************************************************************************/
#include "emu.h"
+#include "includes/pandoras.h"
+#include "includes/konamipt.h"
#include "cpu/m6809/m6809.h"
-#include "cpu/z80/z80.h"
#include "cpu/mcs48/mcs48.h"
+#include "cpu/z80/z80.h"
#include "machine/gen_latch.h"
#include "machine/watchdog.h"
#include "sound/ay8910.h"
#include "sound/dac.h"
-#include "includes/konamipt.h"
-#include "includes/pandoras.h"
+#include "sound/volt_reg.h"
#define MASTER_CLOCK XTAL_18_432MHz
@@ -175,7 +176,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( pandoras_i8039_io_map, AS_IO, 8, pandoras_state )
AM_RANGE(0x00, 0xff) AM_DEVREAD("soundlatch2", generic_latch_8_device, read)
- AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_DEVWRITE("dac", dac_device, write_unsigned8)
+ AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_WRITE(i8039_irqen_and_status_w)
ADDRESS_MAP_END
@@ -356,7 +357,7 @@ static MACHINE_CONFIG_START( pandoras, pandoras_state )
MCFG_PALETTE_INIT_OWNER(pandoras_state, pandoras)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
@@ -364,10 +365,11 @@ static MACHINE_CONFIG_START( pandoras, pandoras_state )
MCFG_SOUND_ADD("aysnd", AY8910, SOUND_CLOCK/8)
MCFG_AY8910_PORT_A_READ_CB(READ8(pandoras_state, pandoras_portA_r)) // not used
MCFG_AY8910_PORT_B_READ_CB(READ8(pandoras_state, pandoras_portB_r))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.4)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.12) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/pastelg.cpp b/src/mame/drivers/pastelg.cpp
index 10c1a2204f5..63c9261496a 100644
--- a/src/mame/drivers/pastelg.cpp
+++ b/src/mame/drivers/pastelg.cpp
@@ -23,19 +23,12 @@ Memo:
******************************************************************************/
#include "emu.h"
+#include "includes/pastelg.h"
#include "cpu/z80/z80.h"
+#include "machine/nvram.h"
#include "sound/ay8910.h"
#include "sound/dac.h"
-#include "includes/pastelg.h"
-#include "machine/nvram.h"
-
-
-#define SIGNED_DAC 0 // 0:unsigned DAC, 1:signed DAC
-#if SIGNED_DAC
-#define DAC_WRITE write_signed8
-#else
-#define DAC_WRITE write_unsigned8
-#endif
+#include "sound/volt_reg.h"
void pastelg_state::machine_start()
@@ -73,7 +66,7 @@ static ADDRESS_MAP_START( pastelg_io_map, AS_IO, 8, pastelg_state )
AM_RANGE(0xb0, 0xb0) AM_DEVREAD("nb1413m3", nb1413m3_device, inputport2_r) AM_WRITE(pastelg_romsel_w)
AM_RANGE(0xc0, 0xc0) AM_READ(pastelg_sndrom_r)
AM_RANGE(0xc0, 0xcf) AM_WRITEONLY AM_SHARE("clut")
- AM_RANGE(0xd0, 0xd0) AM_READ(pastelg_irq_ack_r) AM_DEVWRITE("dac", dac_device, write_unsigned8)
+ AM_RANGE(0xd0, 0xd0) AM_READ(pastelg_irq_ack_r) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(0xe0, 0xe0) AM_READ_PORT("DSWC")
ADDRESS_MAP_END
@@ -126,7 +119,7 @@ static ADDRESS_MAP_START( threeds_io_map, AS_IO, 8, pastelg_state )
AM_RANGE(0xb0, 0xb0) AM_READ(threeds_inputport2_r) AM_WRITE(threeds_output_w)//writes: bit 3 is coin lockout, bit 1 is coin counter
AM_RANGE(0xc0, 0xcf) AM_WRITEONLY AM_SHARE("clut")
AM_RANGE(0xc0, 0xc0) AM_READ(threeds_rom_readback_r)
- AM_RANGE(0xd0, 0xd0) AM_READ(pastelg_irq_ack_r) AM_DEVWRITE("dac", dac_device, write_unsigned8)
+ AM_RANGE(0xd0, 0xd0) AM_READ(pastelg_irq_ack_r) AM_DEVWRITE("dac", dac_byte_interface, write)
ADDRESS_MAP_END
static INPUT_PORTS_START( pastelg )
@@ -425,15 +418,16 @@ static MACHINE_CONFIG_START( pastelg, pastelg_state )
MCFG_PALETTE_INIT_OWNER(pastelg_state, pastelg)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_SOUND_ADD("aysnd", AY8910, 1250000)
MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSWB"))
MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSWA"))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.35)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.35)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
/*
@@ -483,15 +477,16 @@ static MACHINE_CONFIG_START( threeds, pastelg_state )
MCFG_PALETTE_INIT_OWNER(pastelg_state, pastelg)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_SOUND_ADD("aysnd", AY8910, 1250000)
MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSWB"))
MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSWA"))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.35)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.35)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/playch10.cpp b/src/mame/drivers/playch10.cpp
index e2d409fd076..56b4e4f0be6 100644
--- a/src/mame/drivers/playch10.cpp
+++ b/src/mame/drivers/playch10.cpp
@@ -296,7 +296,6 @@ Notes & Todo:
#include "cpu/z80/z80.h"
#include "machine/rp5h01.h"
#include "machine/nvram.h"
-#include "sound/dac.h"
#include "rendlay.h"
#include "includes/playch10.h"
diff --git a/src/mame/drivers/pocketc.cpp b/src/mame/drivers/pocketc.cpp
index 324b342a372..6af288dc643 100644
--- a/src/mame/drivers/pocketc.cpp
+++ b/src/mame/drivers/pocketc.cpp
@@ -734,9 +734,6 @@ static MACHINE_CONFIG_START( pocketc, pocketc_state)
MCFG_PALETTE_ADD("palette", 8*2)
MCFG_PALETTE_INDIRECT_ENTRIES(6)
MCFG_PALETTE_INIT_OWNER( pocketc_state, pocketc )
-
- /* sound hardware */
- /*MCFG_SOUND_ADD("dac", DAC, pocketc_sound_interface)*/
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED_CLASS( pc1401, pocketc, pc1401_state )
diff --git a/src/mame/drivers/pockstat.cpp b/src/mame/drivers/pockstat.cpp
index 937452cf688..f7822a8d8fe 100644
--- a/src/mame/drivers/pockstat.cpp
+++ b/src/mame/drivers/pockstat.cpp
@@ -41,12 +41,12 @@ If you do nothing for about 20 secs, it turns itself off (screen goes white).
****************************************************************************/
#include "emu.h"
+#include "bus/generic/carts.h"
+#include "bus/generic/slot.h"
#include "cpu/arm7/arm7.h"
#include "cpu/arm7/arm7core.h"
#include "sound/dac.h"
-
-#include "bus/generic/slot.h"
-#include "bus/generic/carts.h"
+#include "sound/volt_reg.h"
#define MAX_PS_TIMERS 3
@@ -108,13 +108,11 @@ public:
: driver_device(mconfig, type, tag),
m_lcd_buffer(*this, "lcd_buffer"),
m_maincpu(*this, "maincpu"),
- m_dac(*this, "dac"),
m_cart(*this, "cartslot")
{ }
required_shared_ptr<UINT32> m_lcd_buffer;
required_device<cpu_device> m_maincpu;
- required_device<dac_device> m_dac;
required_device<generic_slot_device> m_cart;
memory_region *m_cart_rom;
@@ -143,7 +141,6 @@ public:
DECLARE_WRITE32_MEMBER(ps_flash_w);
DECLARE_READ32_MEMBER(ps_audio_r);
DECLARE_WRITE32_MEMBER(ps_audio_w);
- DECLARE_WRITE32_MEMBER(ps_dac_w);
virtual void machine_start() override;
virtual void machine_reset() override;
UINT32 screen_update_pockstat(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
@@ -840,11 +837,6 @@ WRITE32_MEMBER(pockstat_state::ps_audio_w)
verboselog(0, "ps_audio_w: Unknown Write: %08x = %08x & %08x\n", 0xd800000 + (offset << 2), data, mem_mask);
}
-WRITE32_MEMBER(pockstat_state::ps_dac_w)
-{
- m_dac->write_unsigned16((UINT16)((data + 0x8000) & 0x0000ffff));
-}
-
static ADDRESS_MAP_START(pockstat_mem, AS_PROGRAM, 32, pockstat_state )
AM_RANGE(0x00000000, 0x000007ff) AM_RAM
AM_RANGE(0x02000000, 0x02ffffff) AM_READ(ps_rombank_r)
@@ -858,7 +850,7 @@ static ADDRESS_MAP_START(pockstat_mem, AS_PROGRAM, 32, pockstat_state )
AM_RANGE(0x0d000000, 0x0d000003) AM_READWRITE(ps_lcd_r, ps_lcd_w)
AM_RANGE(0x0d000100, 0x0d00017f) AM_RAM AM_SHARE("lcd_buffer")
AM_RANGE(0x0d80000c, 0x0d80000f) AM_READWRITE(ps_audio_r, ps_audio_w)
- AM_RANGE(0x0d800014, 0x0d800017) AM_WRITE(ps_dac_w)
+ AM_RANGE(0x0d800014, 0x0d800017) AM_DEVWRITE16("dac", dac_word_interface, write, 0x0000ffff)
ADDRESS_MAP_END
/* Input ports */
@@ -993,9 +985,10 @@ static MACHINE_CONFIG_START( pockstat, pockstat_state )
MCFG_PALETTE_ADD_MONOCHROME("palette")
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("dac", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
/* cartridge */
MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "pockstat_cart")
diff --git a/src/mame/drivers/pong.cpp b/src/mame/drivers/pong.cpp
index b960e6e55a1..3b0eb06ea82 100644
--- a/src/mame/drivers/pong.cpp
+++ b/src/mame/drivers/pong.cpp
@@ -49,11 +49,11 @@ TODO: Superpong is believed to use the Pong (Rev E) PCB with some minor modifica
#include "machine/netlist.h"
#include "netlist/devices/net_lib.h"
#include "sound/dac.h"
+#include "sound/volt_reg.h"
#include "video/fixfreq.h"
#include "machine/nl_breakout.h"
#include "machine/nl_pong.h"
#include "machine/nl_pongd.h"
-
#include "breakout.lh"
/*
@@ -135,11 +135,11 @@ public:
// devices
required_device<netlist_mame_device_t> m_maincpu;
required_device<fixedfreq_device> m_video;
- required_device<dac_device> m_dac; /* just to have a sound device */
+ required_device<dac_word_interface> m_dac; /* just to have a sound device */
NETDEV_ANALOG_CALLBACK_MEMBER(sound_cb)
{
- m_dac->write_unsigned8(64*data);
+ m_dac->write(std::round(16384 * data));
}
protected:
@@ -389,10 +389,10 @@ static MACHINE_CONFIG_START( pong, pong_state )
MCFG_FIXFREQ_SYNC_THRESHOLD(0.11)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("dac", DAC, 48000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
-
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( breakout, breakout_state )
@@ -442,10 +442,10 @@ static MACHINE_CONFIG_START( breakout, breakout_state )
MCFG_FIXFREQ_GAIN(1.5)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("dac", DAC, 48000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
-
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( pongf, pong )
@@ -486,10 +486,10 @@ static MACHINE_CONFIG_START( pongd, pong_state )
MCFG_FIXFREQ_SYNC_THRESHOLD(0.11)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("dac", DAC, 48000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
-
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
/***************************************************************************
diff --git a/src/mame/drivers/ppmast93.cpp b/src/mame/drivers/ppmast93.cpp
index 9f157dd6cbc..2cb57231ceb 100644
--- a/src/mame/drivers/ppmast93.cpp
+++ b/src/mame/drivers/ppmast93.cpp
@@ -134,8 +134,9 @@ Dip locations added based on the notes above.
#include "emu.h"
#include "cpu/z80/z80.h"
#include "machine/gen_latch.h"
-#include "sound/ym2413.h"
#include "sound/dac.h"
+#include "sound/volt_reg.h"
+#include "sound/ym2413.h"
class ppmast93_state : public driver_device
@@ -144,15 +145,11 @@ public:
ppmast93_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
- m_dac(*this, "dac"),
- m_ymsnd(*this, "ymsnd"),
m_gfxdecode(*this, "gfxdecode"),
m_bgram(*this, "bgram"),
m_fgram(*this, "fgram") { }
required_device<cpu_device> m_maincpu;
- required_device<dac_device> m_dac;
- required_device<ym2413_device> m_ymsnd;
required_device<gfxdecode_device> m_gfxdecode;
required_shared_ptr<UINT8> m_bgram;
@@ -164,7 +161,6 @@ public:
DECLARE_WRITE8_MEMBER(fgram_w);
DECLARE_WRITE8_MEMBER(bgram_w);
DECLARE_WRITE8_MEMBER(port4_w);
- DECLARE_WRITE8_MEMBER(sound_w);
TILE_GET_INFO_MEMBER(get_bg_tile_info);
TILE_GET_INFO_MEMBER(get_fg_tile_info);
@@ -225,20 +221,10 @@ static ADDRESS_MAP_START( ppmast93_cpu2_map, AS_PROGRAM, 8, ppmast93_state )
AM_RANGE(0xfd00, 0xffff) AM_RAM
ADDRESS_MAP_END
-
-WRITE8_MEMBER(ppmast93_state::sound_w)
-{
- switch(offset&0xff)
- {
- case 0:
- case 1: m_ymsnd->write(space,offset,data); break;
- case 2: m_dac->write_unsigned8(data);break;
- default: logerror("%x %x - %x\n",offset,data,space.device().safe_pcbase());
- }
-}
-
static ADDRESS_MAP_START( ppmast93_cpu2_io, AS_IO, 8, ppmast93_state )
- AM_RANGE(0x0000, 0xffff) AM_ROM AM_WRITE(sound_w) AM_REGION("sub", 0x20000)
+ AM_RANGE(0x0000, 0xffff) AM_ROM AM_REGION("sub", 0x20000)
+ AM_RANGE(0x0000, 0x0001) AM_MIRROR(0xff00) AM_DEVWRITE("ymsnd", ym2413_device, write)
+ AM_RANGE(0x0002, 0x0002) AM_MIRROR(0xff00) AM_DEVWRITE("dac", dac_byte_interface, write)
ADDRESS_MAP_END
static INPUT_PORTS_START( ppmast93 )
@@ -398,16 +384,16 @@ static MACHINE_CONFIG_START( ppmast93, ppmast93_state )
MCFG_PALETTE_ADD_RRRRGGGGBBBB_PROMS("palette", 0x100)
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("ymsnd", YM2413, 5000000/2)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
-
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.60)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.3) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
ROM_START( ppmast93 )
diff --git a/src/mame/drivers/quasar.cpp b/src/mame/drivers/quasar.cpp
index dba0ff9a92e..89a5aef0983 100644
--- a/src/mame/drivers/quasar.cpp
+++ b/src/mame/drivers/quasar.cpp
@@ -30,10 +30,10 @@ I8085 Sound Board
************************************************************************/
#include "emu.h"
+#include "includes/quasar.h"
#include "cpu/s2650/s2650.h"
#include "cpu/mcs48/mcs48.h"
-#include "sound/dac.h"
-#include "includes/quasar.h"
+#include "sound/volt_reg.h"
/************************************************************************
@@ -144,7 +144,7 @@ static ADDRESS_MAP_START( sound_portmap, AS_IO, 8, quasar_state )
AM_RANGE(0x00, 0x7f) AM_RAM
AM_RANGE(0x80, 0x80) AM_READ(quasar_sh_command_r)
AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_READ(audio_t1_r)
- AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_DEVWRITE("dac", dac_device, write_signed8)
+ AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_DEVWRITE("dac", dac_byte_interface, write)
ADDRESS_MAP_END
/************************************************************************
@@ -338,12 +338,12 @@ static MACHINE_CONFIG_START( quasar, quasar_state )
MCFG_VIDEO_START_OVERRIDE(quasar_state,quasar)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
-
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
ROM_START( quasar )
diff --git a/src/mame/drivers/quizshow.cpp b/src/mame/drivers/quizshow.cpp
index 543a06a2d5e..e58593491b8 100644
--- a/src/mame/drivers/quizshow.cpp
+++ b/src/mame/drivers/quizshow.cpp
@@ -17,7 +17,7 @@ TODO:
#include "emu.h"
#include "cpu/s2650/s2650.h"
#include "sound/dac.h"
-
+#include "sound/volt_reg.h"
#include "quizshow.lh"
@@ -46,7 +46,7 @@ public:
{ }
required_device<cpu_device> m_maincpu;
- required_device<dac_device> m_dac;
+ required_device<dac_bit_interface> m_dac;
required_shared_ptr<UINT8> m_main_ram;
required_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen;
@@ -173,7 +173,7 @@ WRITE8_MEMBER(quizshow_state::quizshow_tape_control_w)
WRITE8_MEMBER(quizshow_state::quizshow_audio_w)
{
// d1: audio out
- m_dac->write_signed8((data & 2) ? 0x7f : 0);
+ m_dac->write(BIT(data, 1));
// d0, d2-d7: N/C
}
@@ -397,10 +397,11 @@ static MACHINE_CONFIG_START( quizshow, quizshow_state )
MCFG_PALETTE_INIT_OWNER(quizshow_state, quizshow)
/* sound hardware (discrete) */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SOUND_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/rastersp.cpp b/src/mame/drivers/rastersp.cpp
index 8176fb3f749..c1d261e2881 100644
--- a/src/mame/drivers/rastersp.cpp
+++ b/src/mame/drivers/rastersp.cpp
@@ -21,9 +21,9 @@
#include "machine/53c7xx.h"
#include "machine/mc146818.h"
#include "machine/nscsi_hd.h"
-#include "sound/dac.h"
#include "machine/nvram.h"
-
+#include "sound/dac.h"
+#include "sound/volt_reg.h"
/*************************************
*
@@ -52,8 +52,8 @@ public:
m_maincpu(*this, "maincpu"),
m_dsp(*this, "dsp"),
m_dram(*this, "dram"),
- m_dac_l(*this, "dac_l"),
- m_dac_r(*this, "dac_r"),
+ m_ldac(*this, "ldac"),
+ m_rdac(*this, "rdac"),
m_tms_timer1(*this, "tms_timer1"),
m_tms_tx_timer(*this, "tms_tx_timer"),
m_palette(*this, "palette"),
@@ -99,8 +99,8 @@ public:
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_dsp;
required_shared_ptr<UINT32> m_dram;
- required_device<dac_device> m_dac_l;
- required_device<dac_device> m_dac_r;
+ required_device<dac_word_interface> m_ldac;
+ required_device<dac_word_interface> m_rdac;
required_device<timer_device> m_tms_timer1;
required_device<timer_device> m_tms_tx_timer;
required_device<palette_device> m_palette;
@@ -510,11 +510,8 @@ TIMER_DEVICE_CALLBACK_MEMBER( rastersp_state::tms_tx_timer )
{
UINT32 data = m_tms_io_regs[SPORT_DATA_TX];
- INT16 ldata = data & 0xffff;
- INT16 rdata = data >> 16;
-
- m_dac_l->write_signed16(0x8000 + ldata);
- m_dac_r->write_signed16(0x8000 + rdata);
+ m_ldac->write(data & 0xffff);
+ m_rdac->write(data >> 16);
}
// Set XSREMPTY
@@ -884,10 +881,11 @@ static MACHINE_CONFIG_START( rastersp, rastersp_state )
/* Sound */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
- MCFG_DAC_ADD("dac_l")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_DAC_ADD("dac_r")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
+ MCFG_SOUND_ADD("ldac", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.5) // unknown DAC
+ MCFG_SOUND_ADD("rdac", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.5) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "ldac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "ldac", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "rdac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "rdac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/replicator.cpp b/src/mame/drivers/replicator.cpp
index b219db5fde8..52e95585abd 100644
--- a/src/mame/drivers/replicator.cpp
+++ b/src/mame/drivers/replicator.cpp
@@ -25,11 +25,11 @@
// * implement avr8 WDR (watchdog reset) opcode
#include "emu.h"
-#include "cpu/avr8/avr8.h"
-#include "video/hd44780.h"
#include "rendlay.h"
-#include "debugger.h"
+#include "cpu/avr8/avr8.h"
#include "sound/dac.h"
+#include "sound/volt_reg.h"
+#include "video/hd44780.h"
#define MASTER_CLOCK 16000000
#define LOG_PORTS 0
@@ -177,7 +177,7 @@ public:
required_device<avr8_device> m_maincpu;
required_device<hd44780_device> m_lcdc;
- required_device<dac_device> m_dac;
+ required_device<dac_bit_interface> m_dac;
DECLARE_READ8_MEMBER(port_r);
DECLARE_WRITE8_MEMBER(port_w);
@@ -433,14 +433,9 @@ WRITE8_MEMBER(replicator_state::port_w)
if(changed & BUZZ) printf("[G] BUZZ: %s\n", data & BUZZ ? "HIGH" : "LOW");
#endif
- if(changed & BUZZ){
- /* FIX-ME: What is the largest sample value allowed?
- I'm using 0x3F based on what I see in src/mame/drivers/craft.c
- But as the method is called "write_unsigned8", I guess we could have samples with values up to 0xFF, right?
- Anyway... With the 0x3F value we'll get a sound that is not so loud, which may be less annoying... :-)
- */
- UINT8 audio_sample = (data & BUZZ) ? 0x3F : 0;
- m_dac->write_unsigned8(audio_sample << 1);
+ if (changed & BUZZ)
+ {
+ m_dac->write(BIT(data, 5));
}
m_port_g = data;
@@ -636,10 +631,10 @@ static MACHINE_CONFIG_START( replicator, replicator_state )
/* sound hardware */
/* A piezo is connected to the PORT G bit 5 (OC0B pin driven by Timer/Counter #4) */
- MCFG_SPEAKER_STANDARD_MONO("buzzer")
- MCFG_SOUND_ADD("dac", DAC, 0)
- MCFG_SOUND_ROUTE(0, "buzzer", 1.00)
-
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(0, "speaker", 0.5)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT)
MACHINE_CONFIG_END
ROM_START( replica1 )
diff --git a/src/mame/drivers/rltennis.cpp b/src/mame/drivers/rltennis.cpp
index 20e858041ad..39956156114 100644
--- a/src/mame/drivers/rltennis.cpp
+++ b/src/mame/drivers/rltennis.cpp
@@ -60,11 +60,12 @@ player - when there's nothing to play - first, empty 2k of ROMs are selected.
****************************************************************************************/
+
#include "emu.h"
#include "includes/rltennis.h"
#include "cpu/m68000/m68000.h"
#include "machine/nvram.h"
-#include "sound/dac.h"
+#include "sound/volt_reg.h"
#include "video/ramdac.h"
#define RLT_REFRESH_RATE 60
@@ -141,8 +142,8 @@ TIMER_CALLBACK_MEMBER(rltennis_state::sample_player)
}
++m_dac_counter; /* update low address bits */
- m_dac_1->write_signed8(m_samples_1[m_sample_rom_offset_1 + ( m_dac_counter&0x7ff )]);
- m_dac_2->write_unsigned8(m_samples_2[m_sample_rom_offset_2 + ( m_dac_counter&0x7ff )]);
+ m_dac1->write(m_samples_1[m_sample_rom_offset_1 + (m_dac_counter & 0x7ff)]);
+ m_dac2->write(m_samples_2[m_sample_rom_offset_2 + (m_dac_counter & 0x7ff)]);
m_timer->adjust(attotime::from_hz( RLT_TIMER_FREQ ));
}
@@ -198,13 +199,13 @@ static MACHINE_CONFIG_START( rltennis, rltennis_state )
MCFG_RAMDAC_ADD("ramdac", ramdac_map, "palette")
MCFG_RAMDAC_SPLIT_READ(1)
- MCFG_SPEAKER_STANDARD_MONO("mono")
-
- MCFG_DAC_ADD("dac1")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", .5)
- MCFG_DAC_ADD("dac2")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", .5)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac1", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) // unknown DAC
+ MCFG_SOUND_ADD("dac2", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac1", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac1", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac2", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac2", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
ROM_START( rltennis )
diff --git a/src/mame/drivers/route16.cpp b/src/mame/drivers/route16.cpp
index 74037fc663b..0c1dafe967b 100644
--- a/src/mame/drivers/route16.cpp
+++ b/src/mame/drivers/route16.cpp
@@ -70,10 +70,11 @@
***************************************************************************/
#include "emu.h"
+#include "includes/route16.h"
#include "cpu/z80/z80.h"
-#include "sound/dac.h"
#include "sound/ay8910.h"
-#include "includes/route16.h"
+#include "sound/dac.h"
+#include "sound/volt_reg.h"
@@ -265,7 +266,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( stratvox_cpu2_map, AS_PROGRAM, 8, route16_state )
AM_RANGE(0x0000, 0x1fff) AM_ROM
- AM_RANGE(0x2800, 0x2800) AM_DEVWRITE("dac", dac_device, write_unsigned8)
+ AM_RANGE(0x2800, 0x2800) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(0x4000, 0x43ff) AM_RAM AM_SHARE("sharedram")
AM_RANGE(0x8000, 0xbfff) AM_RAM AM_SHARE("videoram2")
ADDRESS_MAP_END
@@ -575,9 +576,9 @@ static MACHINE_CONFIG_START( route16, route16_state )
MCFG_PALETTE_ADD_3BIT_RGB("palette")
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_SOUND_ADD("ay8910", AY8910, 10000000/8)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
MACHINE_CONFIG_END
@@ -621,10 +622,11 @@ static MACHINE_CONFIG_DERIVED( stratvox, route16 )
MCFG_SN76477_MIXER_PARAMS(0, 0, 0) // mixer A, B, C
MCFG_SN76477_ENVELOPE_PARAMS(0, 0) // envelope 1, 2
MCFG_SN76477_ENABLE(1) // enable
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/rowamet.cpp b/src/mame/drivers/rowamet.cpp
index bb303383d6a..5b850491fdc 100644
--- a/src/mame/drivers/rowamet.cpp
+++ b/src/mame/drivers/rowamet.cpp
@@ -22,9 +22,11 @@ ToDO:
*************************************************************************************/
-#include "machine/genpin.h"
+#include "emu.h"
#include "cpu/z80/z80.h"
+#include "machine/genpin.h"
#include "sound/dac.h"
+#include "sound/volt_reg.h"
#include "rowamet.lh"
class rowamet_state : public driver_device
@@ -78,7 +80,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( rowamet_sub_io, AS_IO, 8, rowamet_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x00) AM_READWRITE(sound_r,mute_w)
- AM_RANGE(0x01, 0x01) AM_DEVWRITE("dac", dac_device, write_unsigned8)
+ AM_RANGE(0x01, 0x01) AM_DEVWRITE("dac", dac_byte_interface, write)
ADDRESS_MAP_END
static INPUT_PORTS_START( rowamet )
@@ -216,9 +218,10 @@ static MACHINE_CONFIG_START( rowamet, rowamet_state )
MCFG_DEFAULT_LAYOUT(layout_rowamet)
/* Sound */
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
/*-------------------------------------------------------------------
diff --git a/src/mame/drivers/royalmah.cpp b/src/mame/drivers/royalmah.cpp
index 53f8e77629b..3b287790e55 100644
--- a/src/mame/drivers/royalmah.cpp
+++ b/src/mame/drivers/royalmah.cpp
@@ -97,9 +97,10 @@ Stephh's notes (based on the games Z80 code and some tests) :
#include "cpu/tlcs90/tlcs90.h"
#include "machine/gen_latch.h"
#include "machine/msm6242.h"
+#include "machine/nvram.h"
#include "sound/ay8910.h"
#include "sound/dac.h"
-#include "machine/nvram.h"
+#include "sound/volt_reg.h"
class royalmah_state : public driver_device
@@ -841,7 +842,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( jansou_sub_iomap, AS_IO, 8, royalmah_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x00, 0x00) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_DEVWRITE("dac", dac_device, write_unsigned8 )
+ AM_RANGE(0x00, 0x00) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_DEVWRITE("dac", dac_byte_interface, write)
ADDRESS_MAP_END
@@ -3326,12 +3327,12 @@ static MACHINE_CONFIG_START( royalmah, royalmah_state )
MCFG_SCREEN_PALETTE("palette")
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_SOUND_ADD("aysnd", AY8910, 18432000/12)
MCFG_AY8910_PORT_A_READ_CB(READ8(royalmah_state, royalmah_player_1_port_r))
MCFG_AY8910_PORT_B_READ_CB(READ8(royalmah_state, royalmah_player_2_port_r))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.33)
MACHINE_CONFIG_END
@@ -3359,8 +3360,9 @@ static MACHINE_CONFIG_DERIVED( jansou, royalmah )
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( dondenmj, royalmah )
diff --git a/src/mame/drivers/s11.cpp b/src/mame/drivers/s11.cpp
index a82700559e5..4ee8972f1a8 100644
--- a/src/mame/drivers/s11.cpp
+++ b/src/mame/drivers/s11.cpp
@@ -17,16 +17,10 @@ ToDo:
*****************************************************************************************/
-
-#include "machine/genpin.h"
+#include "includes/s11.h"
#include "cpu/m6800/m6800.h"
#include "cpu/m6809/m6809.h"
-#include "machine/6821pia.h"
-#include "sound/hc55516.h"
-#include "sound/ym2151.h"
-#include "sound/dac.h"
-#include "audio/s11c_bg.h"
-#include "includes/s11.h"
+#include "sound/volt_reg.h"
#include "s11.lh"
static ADDRESS_MAP_START( s11_main_map, AS_PROGRAM, 8, s11_state )
@@ -342,23 +336,11 @@ WRITE_LINE_MEMBER( s11_state::pias_cb2_w )
m_hc55516->digit_w(state);
}
-READ8_MEMBER( s11_state::dac_r )
+READ8_MEMBER( s11_state::sound_r )
{
return m_sound_data;
}
-WRITE8_MEMBER( s11_state::dac_w )
-{
- if(m_dac)
- m_dac->write_unsigned8(data);
-}
-
-WRITE8_MEMBER( s11_state::pia40_pa_w )
-{
- if(m_dac1)
- m_dac1->write_unsigned8(data);
-}
-
WRITE_LINE_MEMBER( s11_state::ym2151_irq_w )
{
if(m_pia40)
@@ -406,7 +388,7 @@ static MACHINE_CONFIG_START( s11, s11_state )
/* Devices */
MCFG_DEVICE_ADD("pia21", PIA6821, 0)
- MCFG_PIA_READPA_HANDLER(READ8(s11_state, dac_r))
+ MCFG_PIA_READPA_HANDLER(READ8(s11_state, sound_r))
MCFG_PIA_WRITEPA_HANDLER(WRITE8(s11_state, sound_w))
MCFG_PIA_WRITEPB_HANDLER(WRITE8(s11_state, sol2_w))
MCFG_PIA_CA2_HANDLER(WRITELINE(s11_state, pia21_ca2_w))
@@ -456,18 +438,20 @@ static MACHINE_CONFIG_START( s11, s11_state )
MCFG_CPU_ADD("audiocpu", M6808, XTAL_4MHz)
MCFG_CPU_PROGRAM_MAP(s11_audio_map)
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac1", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac1", -1.0, DAC_VREF_NEG_INPUT)
MCFG_SPEAKER_STANDARD_MONO("speech")
MCFG_SOUND_ADD("hc55516", HC55516, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speech", 1.00)
MCFG_DEVICE_ADD("pias", PIA6821, 0)
- MCFG_PIA_READPA_HANDLER(READ8(s11_state, dac_r))
+ MCFG_PIA_READPA_HANDLER(READ8(s11_state, sound_r))
MCFG_PIA_WRITEPA_HANDLER(WRITE8(s11_state, sound_w))
- MCFG_PIA_WRITEPB_HANDLER(WRITE8(s11_state, dac_w))
+ MCFG_PIA_WRITEPB_HANDLER(DEVWRITE8("dac", dac_byte_interface, write))
MCFG_PIA_CA2_HANDLER(WRITELINE(s11_state, pias_ca2_w))
MCFG_PIA_CB2_HANDLER(WRITELINE(s11_state, pias_cb2_w))
MCFG_PIA_IRQA_HANDLER(INPUTLINE("audiocpu", M6808_IRQ_LINE))
@@ -482,11 +466,10 @@ static MACHINE_CONFIG_START( s11, s11_state )
MCFG_YM2151_IRQ_HANDLER(WRITELINE(s11_state, ym2151_irq_w))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "bg", 0.50)
- MCFG_DAC_ADD("dac1")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "bg", 0.50)
+ MCFG_SOUND_ADD("dac1", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "bg", 0.25) // unknown DAC
MCFG_DEVICE_ADD("pia40", PIA6821, 0)
- MCFG_PIA_WRITEPA_HANDLER(WRITE8(s11_state, pia40_pa_w))
+ MCFG_PIA_WRITEPA_HANDLER(DEVWRITE8("dac1", dac_byte_interface, write))
MCFG_PIA_WRITEPB_HANDLER(WRITE8(s11_state, pia40_pb_w))
MCFG_PIA_CB2_HANDLER(WRITELINE(s11_state, pia40_cb2_w))
MCFG_PIA_IRQA_HANDLER(INPUTLINE("bgcpu", M6809_FIRQ_LINE))
diff --git a/src/mame/drivers/s11a.cpp b/src/mame/drivers/s11a.cpp
index b1ac0ab8256..e53d0b28a0b 100644
--- a/src/mame/drivers/s11a.cpp
+++ b/src/mame/drivers/s11a.cpp
@@ -20,16 +20,10 @@ Note: To start a game, certain switches need to be activated. You must first pr
*****************************************************************************************/
-
-#include "machine/genpin.h"
+#include "includes/s11a.h"
#include "cpu/m6800/m6800.h"
#include "cpu/m6809/m6809.h"
-#include "machine/6821pia.h"
-#include "sound/hc55516.h"
-#include "sound/ym2151.h"
-#include "sound/dac.h"
-#include "audio/s11c_bg.h"
-#include "includes/s11a.h"
+#include "sound/volt_reg.h"
#include "s11a.lh"
static ADDRESS_MAP_START( s11a_main_map, AS_PROGRAM, 8, s11a_state )
@@ -186,7 +180,7 @@ static MACHINE_CONFIG_START( s11a, s11a_state )
/* Devices */
MCFG_DEVICE_ADD("pia21", PIA6821, 0)
- MCFG_PIA_READPA_HANDLER(READ8(s11_state, dac_r))
+ MCFG_PIA_READPA_HANDLER(READ8(s11_state, sound_r))
MCFG_PIA_WRITEPA_HANDLER(WRITE8(s11_state, sound_w))
MCFG_PIA_WRITEPB_HANDLER(WRITE8(s11_state, sol2_w))
MCFG_PIA_CA2_HANDLER(WRITELINE(s11_state, pia21_ca2_w))
@@ -236,18 +230,20 @@ static MACHINE_CONFIG_START( s11a, s11a_state )
MCFG_CPU_ADD("audiocpu", M6802, XTAL_4MHz)
MCFG_CPU_PROGRAM_MAP(s11a_audio_map)
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac1", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac1", -1.0, DAC_VREF_NEG_INPUT)
MCFG_SPEAKER_STANDARD_MONO("speech")
MCFG_SOUND_ADD("hc55516", HC55516, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speech", 0.50)
MCFG_DEVICE_ADD("pias", PIA6821, 0)
- MCFG_PIA_READPA_HANDLER(READ8(s11_state, dac_r))
+ MCFG_PIA_READPA_HANDLER(READ8(s11_state, sound_r))
MCFG_PIA_WRITEPA_HANDLER(WRITE8(s11_state, sound_w))
- MCFG_PIA_WRITEPB_HANDLER(WRITE8(s11_state, dac_w))
+ MCFG_PIA_WRITEPB_HANDLER(DEVWRITE8("dac", dac_byte_interface, write))
MCFG_PIA_CB2_HANDLER(WRITELINE(s11_state, pia40_cb2_w))
MCFG_PIA_IRQA_HANDLER(INPUTLINE("audiocpu", M6802_IRQ_LINE))
MCFG_PIA_IRQB_HANDLER(INPUTLINE("audiocpu", M6802_IRQ_LINE))
@@ -261,11 +257,10 @@ static MACHINE_CONFIG_START( s11a, s11a_state )
MCFG_YM2151_IRQ_HANDLER(WRITELINE(s11a_state, ym2151_irq_w))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "bg", 0.50)
- MCFG_DAC_ADD("dac1")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "bg", 0.50)
+ MCFG_SOUND_ADD("dac1", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "bg", 0.25) // unknown DAC
MCFG_DEVICE_ADD("pia40", PIA6821, 0)
- MCFG_PIA_WRITEPA_HANDLER(WRITE8(s11_state, pia40_pa_w))
+ MCFG_PIA_WRITEPA_HANDLER(DEVWRITE8("dac1", dac_byte_interface, write))
MCFG_PIA_WRITEPB_HANDLER(WRITE8(s11_state, pia40_pb_w))
MCFG_PIA_CA2_HANDLER(WRITELINE(s11_state, pias_ca2_w))
MCFG_PIA_CB2_HANDLER(WRITELINE(s11_state, pias_cb2_w))
diff --git a/src/mame/drivers/s11b.cpp b/src/mame/drivers/s11b.cpp
index 06389587017..b7f2b29aa9a 100644
--- a/src/mame/drivers/s11b.cpp
+++ b/src/mame/drivers/s11b.cpp
@@ -20,16 +20,10 @@
- Cyclone: Nothing. The game doesn't bother to check if the ball is ready before allowing start. Insert 1 or more credits first, of course.
*/
-
-#include "machine/genpin.h"
+#include "includes/s11b.h"
#include "cpu/m6800/m6800.h"
#include "cpu/m6809/m6809.h"
-#include "machine/6821pia.h"
-#include "sound/hc55516.h"
-#include "sound/ym2151.h"
-#include "sound/dac.h"
-#include "audio/s11c_bg.h"
-#include "includes/s11b.h"
+#include "sound/volt_reg.h"
#include "s11b.lh"
static ADDRESS_MAP_START( s11b_main_map, AS_PROGRAM, 8, s11b_state )
@@ -265,7 +259,7 @@ static MACHINE_CONFIG_START( s11b, s11b_state )
/* Devices */
MCFG_DEVICE_ADD("pia21", PIA6821, 0)
- MCFG_PIA_READPA_HANDLER(READ8(s11_state, dac_r))
+ MCFG_PIA_READPA_HANDLER(READ8(s11_state, sound_r))
MCFG_PIA_WRITEPA_HANDLER(WRITE8(s11_state, sound_w))
MCFG_PIA_WRITEPB_HANDLER(WRITE8(s11_state, sol2_w))
MCFG_PIA_CA2_HANDLER(WRITELINE(s11_state, pia21_ca2_w))
@@ -315,18 +309,20 @@ static MACHINE_CONFIG_START( s11b, s11b_state )
MCFG_CPU_ADD("audiocpu", M6802, XTAL_4MHz)
MCFG_CPU_PROGRAM_MAP(s11b_audio_map)
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac1", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac1", -1.0, DAC_VREF_NEG_INPUT)
MCFG_SPEAKER_STANDARD_MONO("speech")
MCFG_SOUND_ADD("hc55516", HC55516, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speech", 0.50)
MCFG_DEVICE_ADD("pias", PIA6821, 0)
- MCFG_PIA_READPA_HANDLER(READ8(s11_state, dac_r))
+ MCFG_PIA_READPA_HANDLER(READ8(s11_state, sound_r))
MCFG_PIA_WRITEPA_HANDLER(WRITE8(s11_state, sound_w))
- MCFG_PIA_WRITEPB_HANDLER(WRITE8(s11_state, dac_w))
+ MCFG_PIA_WRITEPB_HANDLER(DEVWRITE8("dac", dac_byte_interface, write))
MCFG_PIA_CA2_HANDLER(WRITELINE(s11_state, pias_ca2_w))
MCFG_PIA_CB2_HANDLER(WRITELINE(s11_state, pias_cb2_w))
MCFG_PIA_IRQA_HANDLER(INPUTLINE("audiocpu", M6802_IRQ_LINE))
@@ -342,14 +338,13 @@ static MACHINE_CONFIG_START( s11b, s11b_state )
MCFG_YM2151_IRQ_HANDLER(WRITELINE(s11b_state, ym2151_irq_w))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "bg", 0.25)
- MCFG_DAC_ADD("dac1")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "bg", 0.50)
+ MCFG_SOUND_ADD("dac1", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "bg", 0.25) // unknown DAC
MCFG_SOUND_ADD("hc55516_bg", HC55516, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speech", 0.50)
MCFG_DEVICE_ADD("pia40", PIA6821, 0)
- MCFG_PIA_WRITEPA_HANDLER(WRITE8(s11_state, pia40_pa_w))
+ MCFG_PIA_WRITEPA_HANDLER(DEVWRITE8("dac1", dac_byte_interface, write))
MCFG_PIA_WRITEPB_HANDLER(WRITE8(s11_state, pia40_pb_w))
MCFG_PIA_CA2_HANDLER(WRITELINE(s11b_state, pia40_ca2_w))
MCFG_PIA_CB2_HANDLER(WRITELINE(s11_state, pia40_cb2_w))
diff --git a/src/mame/drivers/s11c.cpp b/src/mame/drivers/s11c.cpp
index a3b413f0cf7..7e8b231cafc 100644
--- a/src/mame/drivers/s11c.cpp
+++ b/src/mame/drivers/s11c.cpp
@@ -4,16 +4,9 @@
Williams System 11c
*/
-
-#include "machine/genpin.h"
+#include "includes/s11c.h"
#include "cpu/m6800/m6800.h"
#include "cpu/m6809/m6809.h"
-#include "machine/6821pia.h"
-#include "sound/hc55516.h"
-#include "sound/ym2151.h"
-#include "sound/dac.h"
-#include "audio/s11c_bg.h"
-#include "includes/s11c.h"
#include "s11c.lh"
@@ -167,7 +160,7 @@ static MACHINE_CONFIG_START( s11c, s11c_state )
/* Devices */
MCFG_DEVICE_ADD("pia21", PIA6821, 0)
- MCFG_PIA_READPA_HANDLER(READ8(s11_state, dac_r))
+ MCFG_PIA_READPA_HANDLER(READ8(s11_state, sound_r))
MCFG_PIA_WRITEPA_HANDLER(WRITE8(s11_state, sound_w))
MCFG_PIA_WRITEPB_HANDLER(WRITE8(s11_state, sol2_w))
MCFG_PIA_CA2_HANDLER(WRITELINE(s11_state, pia21_ca2_w))
@@ -216,30 +209,10 @@ static MACHINE_CONFIG_START( s11c, s11c_state )
// generic sound board is not used in System 11C, except for Star Trax
/* Add the background music card */
- MCFG_WMS_S11C_BG_ADD("bgm",":bgcpu")
- /*
- MCFG_CPU_ADD("bgcpu", M6809E, XTAL_8MHz) // MC68B09E (note: schematics show this as 8mhz/2, but games crash very quickly with that speed?)
- MCFG_CPU_PROGRAM_MAP(s11c_bg_map)
- MCFG_QUANTUM_TIME(attotime::from_hz(50))
-
- MCFG_SPEAKER_STANDARD_MONO("bg")
- MCFG_YM2151_ADD("ym2151", 3580000)
- MCFG_YM2151_IRQ_HANDLER(WRITELINE(s11b_state, ym2151_irq_w))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "bg", 0.25)
-
- MCFG_DAC_ADD("dac1")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "bg", 0.50)
-
- MCFG_SOUND_ADD("hc55516_bg", HC55516, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "bg", 0.50)
-
- MCFG_DEVICE_ADD("pia40", PIA6821, 0)
- MCFG_PIA_WRITEPA_HANDLER(WRITE8(s11_state, pia40_pa_w))
- MCFG_PIA_WRITEPB_HANDLER(WRITE8(s11_state, pia40_pb_w))
- MCFG_PIA_CB2_HANDLER(WRITELINE(s11_state, pia40_cb2_w))
- MCFG_PIA_IRQA_HANDLER(INPUTLINE("bgcpu", M6809_FIRQ_LINE))
- MCFG_PIA_IRQB_HANDLER(INPUTLINE("bgcpu", INPUT_LINE_NMI))
- */
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("bgm", S11C_BG, 0)
+ MCFG_S11C_BG_ROM_REGION(":bgcpu")
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
/*--------------------
diff --git a/src/mame/drivers/s3.cpp b/src/mame/drivers/s3.cpp
index 05e8ff21735..84917d56cce 100644
--- a/src/mame/drivers/s3.cpp
+++ b/src/mame/drivers/s3.cpp
@@ -37,14 +37,14 @@ ToDo:
************************************************************************************/
-
-#include "machine/genpin.h"
+#include "emu.h"
#include "cpu/m6800/m6800.h"
#include "machine/6821pia.h"
+#include "machine/genpin.h"
#include "sound/dac.h"
+#include "sound/volt_reg.h"
#include "s3.lh"
-
class s3_state : public genpin_class
{
public:
@@ -52,7 +52,6 @@ public:
: genpin_class(mconfig, type, tag)
, m_maincpu(*this, "maincpu")
, m_audiocpu(*this, "audiocpu")
- , m_dac(*this, "dac")
, m_pia22(*this, "pia22")
, m_pia24(*this, "pia24")
, m_pia28(*this, "pia28")
@@ -60,7 +59,7 @@ public:
, m_pias(*this, "pias")
{ }
- DECLARE_READ8_MEMBER(dac_r);
+ DECLARE_READ8_MEMBER(sound_r);
DECLARE_WRITE8_MEMBER(dig0_w);
DECLARE_WRITE8_MEMBER(dig1_w);
DECLARE_WRITE8_MEMBER(lamp0_w);
@@ -94,7 +93,6 @@ private:
bool m_chimes;
required_device<cpu_device> m_maincpu;
optional_device<cpu_device> m_audiocpu;
- optional_device<dac_device> m_dac;
required_device<pia6821_device> m_pia22;
required_device<pia6821_device> m_pia24;
required_device<pia6821_device> m_pia28;
@@ -408,7 +406,7 @@ WRITE8_MEMBER( s3_state::switch_w )
m_kbdrow = data;
}
-READ8_MEMBER( s3_state::dac_r )
+READ8_MEMBER( s3_state::sound_r )
{
return m_sound_data;
}
@@ -478,13 +476,15 @@ static MACHINE_CONFIG_DERIVED( s3a, s3 )
MCFG_CPU_ADD("audiocpu", M6802, 3580000)
MCFG_CPU_PROGRAM_MAP(s3_audio_map)
MCFG_MACHINE_RESET_OVERRIDE(s3_state, s3a)
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("dac", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
+
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MCFG_DEVICE_ADD("pias", PIA6821, 0)
- MCFG_PIA_READPB_HANDLER(READ8(s3_state, dac_r))
- MCFG_PIA_WRITEPA_HANDLER(DEVWRITE8("dac", dac_device, write_unsigned8))
+ MCFG_PIA_READPB_HANDLER(READ8(s3_state,sound_r))
+ MCFG_PIA_WRITEPA_HANDLER(DEVWRITE8("dac", dac_byte_interface, write))
MCFG_PIA_IRQA_HANDLER(INPUTLINE("audiocpu", M6802_IRQ_LINE))
MCFG_PIA_IRQB_HANDLER(INPUTLINE("audiocpu", M6802_IRQ_LINE))
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/s4.cpp b/src/mame/drivers/s4.cpp
index f67fd4712c3..c40ee218900 100644
--- a/src/mame/drivers/s4.cpp
+++ b/src/mame/drivers/s4.cpp
@@ -31,10 +31,12 @@ ToDo:
************************************************************************************/
-#include "machine/genpin.h"
+#include "emu.h"
#include "cpu/m6800/m6800.h"
#include "machine/6821pia.h"
+#include "machine/genpin.h"
#include "sound/dac.h"
+#include "sound/volt_reg.h"
#include "s4.lh"
@@ -45,7 +47,6 @@ public:
: genpin_class(mconfig, type, tag)
, m_maincpu(*this, "maincpu")
, m_audiocpu(*this, "audiocpu")
- , m_dac(*this, "dac")
, m_pia22(*this, "pia22")
, m_pia24(*this, "pia24")
, m_pia28(*this, "pia28")
@@ -53,7 +54,7 @@ public:
, m_pias(*this, "pias")
{ }
- DECLARE_READ8_MEMBER(dac_r);
+ DECLARE_READ8_MEMBER(sound_r);
DECLARE_WRITE8_MEMBER(dig0_w);
DECLARE_WRITE8_MEMBER(dig1_w);
DECLARE_WRITE8_MEMBER(lamp0_w);
@@ -87,7 +88,6 @@ private:
bool m_chimes;
required_device<cpu_device> m_maincpu;
optional_device<cpu_device> m_audiocpu;
- optional_device<dac_device> m_dac;
required_device<pia6821_device> m_pia22;
required_device<pia6821_device> m_pia24;
required_device<pia6821_device> m_pia28;
@@ -401,7 +401,7 @@ WRITE8_MEMBER( s4_state::switch_w )
m_kbdrow = data;
}
-READ8_MEMBER( s4_state::dac_r )
+READ8_MEMBER( s4_state::sound_r )
{
return m_sound_data;
}
@@ -471,13 +471,15 @@ static MACHINE_CONFIG_DERIVED( s4a, s4 )
MCFG_CPU_ADD("audiocpu", M6808, 3580000)
MCFG_CPU_PROGRAM_MAP(s4_audio_map)
MCFG_MACHINE_RESET_OVERRIDE(s4_state, s4a)
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("dac", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
+
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MCFG_DEVICE_ADD("pias", PIA6821, 0)
- MCFG_PIA_READPB_HANDLER(READ8(s4_state, dac_r))
- MCFG_PIA_WRITEPA_HANDLER(DEVWRITE8("dac", dac_device, write_unsigned8))
+ MCFG_PIA_READPB_HANDLER(READ8(s4_state, sound_r))
+ MCFG_PIA_WRITEPA_HANDLER(DEVWRITE8("dac", dac_byte_interface, write))
MCFG_PIA_IRQA_HANDLER(INPUTLINE("audiocpu", M6808_IRQ_LINE))
MCFG_PIA_IRQB_HANDLER(INPUTLINE("audiocpu", M6808_IRQ_LINE))
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/s6.cpp b/src/mame/drivers/s6.cpp
index b921f53b1c2..ec30173edaf 100644
--- a/src/mame/drivers/s6.cpp
+++ b/src/mame/drivers/s6.cpp
@@ -46,12 +46,13 @@ ToDo:
************************************************************************************/
-
-#include "machine/genpin.h"
+#include "emu.h"
#include "cpu/m6800/m6800.h"
#include "machine/6821pia.h"
-#include "sound/hc55516.h"
+#include "machine/genpin.h"
#include "sound/dac.h"
+#include "sound/hc55516.h"
+#include "sound/volt_reg.h"
#include "s6.lh"
@@ -62,7 +63,6 @@ public:
: genpin_class(mconfig, type, tag)
, m_maincpu(*this, "maincpu")
, m_audiocpu(*this, "audiocpu")
- , m_dac(*this, "dac")
, m_hc55516(*this, "hc55516")
, m_pias(*this, "pias")
, m_pia22(*this, "pia22")
@@ -71,7 +71,7 @@ public:
, m_pia30(*this, "pia30")
{ }
- DECLARE_READ8_MEMBER(dac_r);
+ DECLARE_READ8_MEMBER(sound_r);
DECLARE_WRITE8_MEMBER(dig0_w);
DECLARE_WRITE8_MEMBER(dig1_w);
DECLARE_WRITE8_MEMBER(lamp0_w);
@@ -104,7 +104,6 @@ private:
static const device_timer_id TIMER_IRQ = 0;
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
- required_device<dac_device> m_dac;
required_device<hc55516_device> m_hc55516;
required_device<pia6821_device> m_pias;
required_device<pia6821_device> m_pia22;
@@ -341,7 +340,7 @@ WRITE8_MEMBER( s6_state::switch_w )
m_kbdrow = data;
}
-READ8_MEMBER( s6_state::dac_r )
+READ8_MEMBER( s6_state::sound_r )
{
return m_sound_data;
}
@@ -445,16 +444,19 @@ static MACHINE_CONFIG_START( s6, s6_state )
/* Add the soundcard */
MCFG_CPU_ADD("audiocpu", M6802, 3580000)
MCFG_CPU_PROGRAM_MAP(s6_audio_map)
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("dac", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
+
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
+
MCFG_SPEAKER_STANDARD_MONO("speech")
MCFG_SOUND_ADD("hc55516", HC55516, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speech", 1.00)
MCFG_DEVICE_ADD("pias", PIA6821, 0)
- MCFG_PIA_READPB_HANDLER(READ8(s6_state, dac_r))
- MCFG_PIA_WRITEPA_HANDLER(DEVWRITE8("dac", dac_device, write_unsigned8))
+ MCFG_PIA_READPB_HANDLER(READ8(s6_state, sound_r))
+ MCFG_PIA_WRITEPA_HANDLER(DEVWRITE8("dac", dac_byte_interface, write))
MCFG_PIA_CA2_HANDLER(DEVWRITELINE("hc55516", hc55516_device, digit_w))
MCFG_PIA_CB2_HANDLER(DEVWRITELINE("hc55516", hc55516_device, clock_w))
MCFG_PIA_IRQA_HANDLER(INPUTLINE("audiocpu", M6802_IRQ_LINE))
diff --git a/src/mame/drivers/s6a.cpp b/src/mame/drivers/s6a.cpp
index ecb2454b3ef..ba773a02cc2 100644
--- a/src/mame/drivers/s6a.cpp
+++ b/src/mame/drivers/s6a.cpp
@@ -39,12 +39,13 @@ ToDo:
************************************************************************************/
-
-#include "machine/genpin.h"
+#include "emu.h"
#include "cpu/m6800/m6800.h"
#include "machine/6821pia.h"
-#include "sound/hc55516.h"
+#include "machine/genpin.h"
#include "sound/dac.h"
+#include "sound/hc55516.h"
+#include "sound/volt_reg.h"
#include "s6a.lh"
@@ -55,7 +56,6 @@ public:
: genpin_class(mconfig, type, tag)
, m_maincpu(*this, "maincpu")
, m_audiocpu(*this, "audiocpu")
- , m_dac(*this, "dac")
, m_hc55516(*this, "hc55516")
, m_pias(*this, "pias")
, m_pia22(*this, "pia22")
@@ -64,7 +64,7 @@ public:
, m_pia30(*this, "pia30")
{ }
- DECLARE_READ8_MEMBER(dac_r);
+ DECLARE_READ8_MEMBER(sound_r);
DECLARE_WRITE8_MEMBER(dig0_w);
DECLARE_WRITE8_MEMBER(dig1_w);
DECLARE_WRITE8_MEMBER(lamp0_w);
@@ -97,7 +97,6 @@ private:
static const device_timer_id TIMER_IRQ = 0;
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
- required_device<dac_device> m_dac;
required_device<hc55516_device> m_hc55516;
required_device<pia6821_device> m_pias;
required_device<pia6821_device> m_pia22;
@@ -324,7 +323,7 @@ WRITE8_MEMBER( s6a_state::switch_w )
m_kbdrow = data;
}
-READ8_MEMBER( s6a_state::dac_r )
+READ8_MEMBER( s6a_state::sound_r )
{
return m_sound_data;
}
@@ -428,16 +427,19 @@ static MACHINE_CONFIG_START( s6a, s6a_state )
/* Add the soundcard */
MCFG_CPU_ADD("audiocpu", M6802, 3580000)
MCFG_CPU_PROGRAM_MAP(s6a_audio_map)
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("dac", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
+
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
+
MCFG_SPEAKER_STANDARD_MONO("speech")
MCFG_SOUND_ADD("hc55516", HC55516, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speech", 1.00)
MCFG_DEVICE_ADD("pias", PIA6821, 0)
- MCFG_PIA_READPB_HANDLER(READ8(s6a_state, dac_r))
- MCFG_PIA_WRITEPA_HANDLER(DEVWRITE8("dac", dac_device, write_unsigned8))
+ MCFG_PIA_READPB_HANDLER(READ8(s6a_state, sound_r))
+ MCFG_PIA_WRITEPA_HANDLER(DEVWRITE8("dac", dac_byte_interface, write))
MCFG_PIA_CA2_HANDLER(DEVWRITELINE("hc55516", hc55516_device, digit_w))
MCFG_PIA_CB2_HANDLER(DEVWRITELINE("hc55516", hc55516_device, clock_w))
MCFG_PIA_IRQA_HANDLER(INPUTLINE("audiocpu", M6802_IRQ_LINE))
diff --git a/src/mame/drivers/s7.cpp b/src/mame/drivers/s7.cpp
index b1eaf21c39d..0af41fade45 100644
--- a/src/mame/drivers/s7.cpp
+++ b/src/mame/drivers/s7.cpp
@@ -56,15 +56,15 @@ ToDo:
*****************************************************************************************/
-
-#include "machine/genpin.h"
+#include "emu.h"
#include "cpu/m6800/m6800.h"
#include "machine/6821pia.h"
-#include "sound/hc55516.h"
+#include "machine/genpin.h"
#include "sound/dac.h"
+#include "sound/hc55516.h"
+#include "sound/volt_reg.h"
#include "s7.lh"
-
class s7_state : public genpin_class
{
public:
@@ -72,7 +72,6 @@ public:
: genpin_class(mconfig, type, tag)
, m_maincpu(*this, "maincpu")
, m_audiocpu(*this, "audiocpu")
- , m_dac(*this, "dac")
, m_hc55516(*this, "hc55516")
, m_pias(*this, "pias")
, m_pia21(*this, "pia21")
@@ -82,7 +81,7 @@ public:
, m_pia30(*this, "pia30")
{ }
- DECLARE_READ8_MEMBER(dac_r);
+ DECLARE_READ8_MEMBER(sound_r);
DECLARE_WRITE8_MEMBER(dig0_w);
DECLARE_WRITE8_MEMBER(dig1_w);
DECLARE_WRITE8_MEMBER(lamp0_w);
@@ -126,7 +125,6 @@ private:
virtual void machine_start() override;
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
- required_device<dac_device> m_dac;
required_device<hc55516_device> m_hc55516;
required_device<pia6821_device> m_pias;
required_device<pia6821_device> m_pia21;
@@ -360,7 +358,7 @@ WRITE8_MEMBER( s7_state::nvram_w )
m_nvram[offset] = data;
}
-READ8_MEMBER( s7_state::dac_r )
+READ8_MEMBER( s7_state::sound_r )
{
return m_sound_data;
}
@@ -481,16 +479,19 @@ static MACHINE_CONFIG_START( s7, s7_state )
/* Add the soundcard */
MCFG_CPU_ADD("audiocpu", M6808, 3580000)
MCFG_CPU_PROGRAM_MAP(s7_audio_map)
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("dac", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
+
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
+
MCFG_SPEAKER_STANDARD_MONO("speech")
MCFG_SOUND_ADD("hc55516", HC55516, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speech", 1.00)
MCFG_DEVICE_ADD("pias", PIA6821, 0)
- MCFG_PIA_READPB_HANDLER(READ8(s7_state, dac_r))
- MCFG_PIA_WRITEPA_HANDLER(DEVWRITE8("dac", dac_device, write_unsigned8))
+ MCFG_PIA_READPB_HANDLER(READ8(s7_state, sound_r))
+ MCFG_PIA_WRITEPA_HANDLER(DEVWRITE8("dac", dac_byte_interface, write))
MCFG_PIA_WRITEPB_HANDLER(NOOP)
MCFG_PIA_READCA1_HANDLER(VCC)
MCFG_PIA_CA2_HANDLER(DEVWRITELINE("hc55516", hc55516_device, digit_w))
diff --git a/src/mame/drivers/s8.cpp b/src/mame/drivers/s8.cpp
index 85c68bc748e..8e1328b2310 100644
--- a/src/mame/drivers/s8.cpp
+++ b/src/mame/drivers/s8.cpp
@@ -44,14 +44,14 @@ ToDo:
************************************************************************************/
-
-#include "machine/genpin.h"
+#include "emu.h"
#include "cpu/m6800/m6800.h"
#include "machine/6821pia.h"
+#include "machine/genpin.h"
#include "sound/dac.h"
+#include "sound/volt_reg.h"
#include "s8.lh"
-
class s8_state : public genpin_class
{
public:
@@ -59,7 +59,6 @@ public:
: genpin_class(mconfig, type, tag)
, m_maincpu(*this, "maincpu")
, m_audiocpu(*this, "audiocpu")
- , m_dac(*this, "dac")
, m_pias(*this, "pias")
, m_pia21(*this, "pia21")
, m_pia24(*this, "pia24")
@@ -67,7 +66,7 @@ public:
, m_pia30(*this, "pia30")
{ }
- DECLARE_READ8_MEMBER(dac_r);
+ DECLARE_READ8_MEMBER(sound_r);
DECLARE_WRITE8_MEMBER(dig0_w);
DECLARE_WRITE8_MEMBER(dig1_w);
DECLARE_WRITE8_MEMBER(lamp0_w);
@@ -98,7 +97,6 @@ private:
static const device_timer_id TIMER_IRQ = 0;
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
- required_device<dac_device> m_dac;
required_device<pia6821_device> m_pias;
required_device<pia6821_device> m_pia21;
required_device<pia6821_device> m_pia24;
@@ -249,7 +247,7 @@ WRITE8_MEMBER( s8_state::switch_w )
m_kbdrow = data;
}
-READ8_MEMBER( s8_state::dac_r )
+READ8_MEMBER( s8_state::sound_r )
{
return m_sound_data;
}
@@ -316,7 +314,7 @@ static MACHINE_CONFIG_START( s8, s8_state )
/* Devices */
MCFG_DEVICE_ADD("pia21", PIA6821, 0)
- MCFG_PIA_READPA_HANDLER(READ8(s8_state, dac_r))
+ MCFG_PIA_READPA_HANDLER(READ8(s8_state, sound_r))
MCFG_PIA_READCA1_HANDLER(READLINE(s8_state, pia21_ca1_r))
MCFG_PIA_WRITEPA_HANDLER(WRITE8(s8_state, sound_w))
MCFG_PIA_WRITEPB_HANDLER(WRITE8(s8_state, sol2_w))
@@ -351,13 +349,15 @@ static MACHINE_CONFIG_START( s8, s8_state )
/* Add the soundcard */
MCFG_CPU_ADD("audiocpu", M6808, XTAL_4MHz)
MCFG_CPU_PROGRAM_MAP(s8_audio_map)
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("dac", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
+
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MCFG_DEVICE_ADD("pias", PIA6821, 0)
- MCFG_PIA_READPA_HANDLER(READ8(s8_state, dac_r))
- MCFG_PIA_WRITEPB_HANDLER(DEVWRITE8("dac", dac_device, write_unsigned8))
+ MCFG_PIA_READPA_HANDLER(READ8(s8_state, sound_r))
+ MCFG_PIA_WRITEPB_HANDLER(DEVWRITE8("dac", dac_byte_interface, write))
MCFG_PIA_IRQA_HANDLER(INPUTLINE("audiocpu", M6808_IRQ_LINE))
MCFG_PIA_IRQB_HANDLER(INPUTLINE("audiocpu", M6808_IRQ_LINE))
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/s8a.cpp b/src/mame/drivers/s8a.cpp
index 16f703c8bb7..3645cdbaa02 100644
--- a/src/mame/drivers/s8a.cpp
+++ b/src/mame/drivers/s8a.cpp
@@ -20,14 +20,14 @@ ToDo:
************************************************************************************/
-
-#include "machine/genpin.h"
+#include "emu.h"
#include "cpu/m6800/m6800.h"
#include "machine/6821pia.h"
+#include "machine/genpin.h"
#include "sound/dac.h"
+#include "sound/volt_reg.h"
#include "s8a.lh"
-
class s8a_state : public genpin_class
{
public:
@@ -35,7 +35,6 @@ public:
: genpin_class(mconfig, type, tag)
, m_maincpu(*this, "maincpu")
, m_audiocpu(*this, "audiocpu")
- , m_dac(*this, "dac")
, m_pias(*this, "pias")
, m_pia21(*this, "pia21")
, m_pia24(*this, "pia24")
@@ -43,7 +42,7 @@ public:
, m_pia30(*this, "pia30")
{ }
- DECLARE_READ8_MEMBER(dac_r);
+ DECLARE_READ8_MEMBER(sound_r);
DECLARE_WRITE8_MEMBER(dig0_w);
DECLARE_WRITE8_MEMBER(dig1_w);
DECLARE_WRITE8_MEMBER(lamp0_w);
@@ -74,7 +73,6 @@ private:
static const device_timer_id TIMER_IRQ = 0;
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
- required_device<dac_device> m_dac;
required_device<pia6821_device> m_pias;
required_device<pia6821_device> m_pia21;
required_device<pia6821_device> m_pia24;
@@ -221,7 +219,7 @@ WRITE8_MEMBER( s8a_state::switch_w )
m_kbdrow = data;
}
-READ8_MEMBER( s8a_state::dac_r )
+READ8_MEMBER( s8a_state::sound_r )
{
return m_sound_data;
}
@@ -288,7 +286,7 @@ static MACHINE_CONFIG_START( s8a, s8a_state )
/* Devices */
MCFG_DEVICE_ADD("pia21", PIA6821, 0)
- MCFG_PIA_READPA_HANDLER(READ8(s8a_state, dac_r))
+ MCFG_PIA_READPA_HANDLER(READ8(s8a_state, sound_r))
MCFG_PIA_READCA1_HANDLER(READLINE(s8a_state, pia21_ca1_r))
MCFG_PIA_WRITEPA_HANDLER(WRITE8(s8a_state, sound_w))
MCFG_PIA_WRITEPB_HANDLER(WRITE8(s8a_state, sol2_w))
@@ -323,13 +321,15 @@ static MACHINE_CONFIG_START( s8a, s8a_state )
/* Add the soundcard */
MCFG_CPU_ADD("audiocpu", M6808, XTAL_4MHz)
MCFG_CPU_PROGRAM_MAP(s8a_audio_map)
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("dac", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
+
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MCFG_DEVICE_ADD("pias", PIA6821, 0)
- MCFG_PIA_READPA_HANDLER(READ8(s8a_state, dac_r))
- MCFG_PIA_WRITEPB_HANDLER(DEVWRITE8("dac", dac_device, write_unsigned8))
+ MCFG_PIA_READPA_HANDLER(READ8(s8a_state, sound_r))
+ MCFG_PIA_WRITEPB_HANDLER(DEVWRITE8("dac", dac_byte_interface, write))
MCFG_PIA_IRQA_HANDLER(INPUTLINE("audiocpu", M6808_IRQ_LINE))
MCFG_PIA_IRQB_HANDLER(INPUTLINE("audiocpu", M6808_IRQ_LINE))
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/s9.cpp b/src/mame/drivers/s9.cpp
index ca628508493..3e9a3d4e42d 100644
--- a/src/mame/drivers/s9.cpp
+++ b/src/mame/drivers/s9.cpp
@@ -31,15 +31,15 @@ ToDo:
*****************************************************************************************/
-
-#include "machine/genpin.h"
+#include "emu.h"
#include "cpu/m6800/m6800.h"
#include "machine/6821pia.h"
+#include "machine/genpin.h"
#include "sound/hc55516.h"
#include "sound/dac.h"
+#include "sound/volt_reg.h"
#include "s9.lh"
-
class s9_state : public genpin_class
{
public:
@@ -47,7 +47,6 @@ public:
: genpin_class(mconfig, type, tag)
, m_maincpu(*this, "maincpu")
, m_audiocpu(*this, "audiocpu")
- , m_dac(*this, "dac")
, m_hc55516(*this, "hc55516")
, m_pias(*this, "pias")
, m_pia21(*this, "pia21")
@@ -56,7 +55,7 @@ public:
, m_pia30(*this, "pia30")
{ }
- DECLARE_READ8_MEMBER(dac_r);
+ DECLARE_READ8_MEMBER(sound_r);
DECLARE_WRITE8_MEMBER(dig0_w);
DECLARE_WRITE8_MEMBER(dig1_w);
DECLARE_WRITE8_MEMBER(lamp0_w) { };
@@ -87,7 +86,6 @@ private:
static const device_timer_id TIMER_IRQ = 0;
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
- required_device<dac_device> m_dac;
required_device<hc55516_device> m_hc55516;
required_device<pia6821_device> m_pias;
required_device<pia6821_device> m_pia21;
@@ -257,7 +255,7 @@ WRITE8_MEMBER( s9_state::switch_w )
m_kbdrow = data;
}
-READ8_MEMBER( s9_state::dac_r )
+READ8_MEMBER( s9_state::sound_r )
{
return m_sound_data;
}
@@ -324,7 +322,7 @@ static MACHINE_CONFIG_START( s9, s9_state )
/* Devices */
MCFG_DEVICE_ADD("pia21", PIA6821, 0)
- MCFG_PIA_READPA_HANDLER(READ8(s9_state, dac_r))
+ MCFG_PIA_READPA_HANDLER(READ8(s9_state, sound_r))
MCFG_PIA_READCA1_HANDLER(READLINE(s9_state, pia21_ca1_r))
MCFG_PIA_WRITEPA_HANDLER(WRITE8(s9_state, sound_w))
MCFG_PIA_WRITEPB_HANDLER(WRITE8(s9_state, sol2_w))
@@ -359,16 +357,19 @@ static MACHINE_CONFIG_START( s9, s9_state )
/* Add the soundcard */
MCFG_CPU_ADD("audiocpu", M6808, XTAL_4MHz)
MCFG_CPU_PROGRAM_MAP(s9_audio_map)
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("dac", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
+
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
+
MCFG_SPEAKER_STANDARD_MONO("speech")
MCFG_SOUND_ADD("hc55516", HC55516, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speech", 1.00)
MCFG_DEVICE_ADD("pias", PIA6821, 0)
- MCFG_PIA_READPA_HANDLER(READ8(s9_state, dac_r))
- MCFG_PIA_WRITEPB_HANDLER(DEVWRITE8("dac", dac_device, write_unsigned8))
+ MCFG_PIA_READPA_HANDLER(READ8(s9_state, sound_r))
+ MCFG_PIA_WRITEPB_HANDLER(DEVWRITE8("dac", dac_byte_interface, write))
MCFG_PIA_CA2_HANDLER(DEVWRITELINE("hc55516", hc55516_device, clock_w))
MCFG_PIA_CB2_HANDLER(DEVWRITELINE("hc55516", hc55516_device, digit_w))
MCFG_PIA_IRQA_HANDLER(INPUTLINE("audiocpu", M6808_IRQ_LINE))
diff --git a/src/mame/drivers/sbasketb.cpp b/src/mame/drivers/sbasketb.cpp
index e66f0b403af..2f4a7ddca20 100644
--- a/src/mame/drivers/sbasketb.cpp
+++ b/src/mame/drivers/sbasketb.cpp
@@ -41,16 +41,16 @@ CPU/Video Board Parts:
***************************************************************************/
#include "emu.h"
-#include "cpu/z80/z80.h"
+#include "includes/sbasketb.h"
+#include "includes/konamipt.h"
+#include "audio/trackfld.h"
#include "cpu/m6809/m6809.h"
-#include "sound/dac.h"
+#include "cpu/z80/z80.h"
#include "machine/gen_latch.h"
#include "machine/konami1.h"
#include "machine/watchdog.h"
-#include "includes/konamipt.h"
-#include "audio/trackfld.h"
-#include "includes/sbasketb.h"
-
+#include "sound/dac.h"
+#include "sound/volt_reg.h"
WRITE8_MEMBER(sbasketb_state::sbasketb_sh_irqtrigger_w)
{
@@ -99,7 +99,7 @@ static ADDRESS_MAP_START( sbasketb_sound_map, AS_PROGRAM, 8, sbasketb_state )
AM_RANGE(0x8000, 0x8000) AM_DEVREAD("trackfld_audio", trackfld_audio_device, hyperspt_sh_timer_r)
AM_RANGE(0xa000, 0xa000) AM_DEVWRITE("vlm", vlm5030_device, data_w) /* speech data */
AM_RANGE(0xc000, 0xdfff) AM_DEVWRITE("trackfld_audio", trackfld_audio_device, hyperspt_sound_w) /* speech and output control */
- AM_RANGE(0xe000, 0xe000) AM_DEVWRITE("dac", dac_device, write_unsigned8)
+ AM_RANGE(0xe000, 0xe000) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(0xe001, 0xe001) AM_WRITE(konami_SN76496_latch_w) /* Loads the snd command into the snd latch */
AM_RANGE(0xe002, 0xe002) AM_WRITE(konami_SN76496_w) /* This address triggers the SN chip to read the data port. */
ADDRESS_MAP_END
@@ -210,20 +210,21 @@ static MACHINE_CONFIG_START( sbasketb, sbasketb_state )
MCFG_PALETTE_INIT_OWNER(sbasketb_state, sbasketb)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("trackfld_audio", TRACKFLD_AUDIO, 0)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.4) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MCFG_SOUND_ADD("snsnd", SN76489, XTAL_14_31818MHz / 8)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MCFG_SOUND_ADD("vlm", VLM5030, XTAL_3_579545MHz) /* Schematics say 3.58MHz, but board uses 3.579545MHz xtal */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
MACHINE_CONFIG_DERIVED(sbasketbu, sbasketb)
diff --git a/src/mame/drivers/sbrkout.cpp b/src/mame/drivers/sbrkout.cpp
index 47dfe922e5d..d27c48cabbd 100644
--- a/src/mame/drivers/sbrkout.cpp
+++ b/src/mame/drivers/sbrkout.cpp
@@ -38,10 +38,9 @@
#include "cpu/m6502/m6502.h"
#include "machine/watchdog.h"
#include "sound/dac.h"
-
+#include "sound/volt_reg.h"
#include "sbrkout.lh"
-
class sbrkout_state : public driver_device
{
public:
@@ -83,7 +82,7 @@ public:
TIMER_CALLBACK_MEMBER(pot_trigger_callback);
void update_nmi_state();
required_device<cpu_device> m_maincpu;
- required_device<dac_device> m_dac;
+ required_device<dac_bit_interface> m_dac;
required_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
@@ -159,7 +158,7 @@ TIMER_CALLBACK_MEMBER(sbrkout_state::scanline_callback)
m_maincpu->set_input_line(0, ASSERT_LINE);
/* update the DAC state */
- m_dac->write_unsigned8((videoram[0x380 + 0x11] & (scanline >> 2)) ? 255 : 0);
+ m_dac->write((videoram[0x380 + 0x11] & (scanline >> 2)) != 0);
/* on the VBLANK, read the pot and schedule an interrupt time for it */
if (scanline == m_screen->visible_area().max_y + 1)
@@ -599,9 +598,10 @@ static MACHINE_CONFIG_START( sbrkout, sbrkout_state )
MCFG_PALETTE_ADD_MONOCHROME("palette")
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.99)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/scramble.cpp b/src/mame/drivers/scramble.cpp
index c5e0af69fa3..60dceb9b7ec 100644
--- a/src/mame/drivers/scramble.cpp
+++ b/src/mame/drivers/scramble.cpp
@@ -32,7 +32,6 @@ Notes:
#include "cpu/z80/z80.h"
#include "cpu/s2650/s2650.h"
#include "sound/ay8910.h"
-#include "sound/dac.h"
#include "machine/i8255.h"
#include "machine/gen_latch.h"
#include "machine/watchdog.h"
diff --git a/src/mame/drivers/segag80r.cpp b/src/mame/drivers/segag80r.cpp
index ce6bfb195c5..790f25e8ede 100644
--- a/src/mame/drivers/segag80r.cpp
+++ b/src/mame/drivers/segag80r.cpp
@@ -108,7 +108,6 @@
#include "emu.h"
#include "cpu/z80/z80.h"
-#include "sound/dac.h"
#include "sound/sn76496.h"
#include "sound/samples.h"
#include "machine/i8255.h"
@@ -826,7 +825,7 @@ static MACHINE_CONFIG_START( g80r_base, segag80r_state )
MCFG_SCREEN_PALETTE("palette")
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MACHINE_CONFIG_END
@@ -937,10 +936,10 @@ static MACHINE_CONFIG_DERIVED( sindbadm, g80r_base )
/* sound hardware */
MCFG_SOUND_ADD("sn1", SN76496, SINDBADM_SOUND_CLOCK/4)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MCFG_SOUND_ADD("sn2", SN76496, SINDBADM_SOUND_CLOCK/2)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/segag80v.cpp b/src/mame/drivers/segag80v.cpp
index e925643f520..f83b59aba7c 100644
--- a/src/mame/drivers/segag80v.cpp
+++ b/src/mame/drivers/segag80v.cpp
@@ -888,7 +888,7 @@ static MACHINE_CONFIG_START( g80v_base, segag80v_state )
MCFG_VECTOR_ADD("vector")
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MACHINE_CONFIG_END
@@ -898,7 +898,7 @@ static MACHINE_CONFIG_DERIVED( elim2, g80v_base )
MCFG_SOUND_ADD("samples", SAMPLES, 0)
MCFG_SAMPLES_CHANNELS(8)
MCFG_SAMPLES_NAMES(elim_sample_names)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
@@ -908,7 +908,7 @@ static MACHINE_CONFIG_DERIVED( spacfury, g80v_base )
MCFG_SOUND_ADD("samples", SAMPLES, 0)
MCFG_SAMPLES_CHANNELS(8)
MCFG_SAMPLES_NAMES(spacfury_sample_names)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.1)
/* speech board */
MCFG_FRAGMENT_ADD(sega_speech_board)
@@ -921,10 +921,10 @@ static MACHINE_CONFIG_DERIVED( zektor, g80v_base )
MCFG_SOUND_ADD("samples", SAMPLES, 0)
MCFG_SAMPLES_CHANNELS(8)
MCFG_SAMPLES_NAMES(zektor_sample_names)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.1)
MCFG_SOUND_ADD("aysnd", AY8910, VIDEO_CLOCK/4/2)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.33)
/* speech board */
MCFG_FRAGMENT_ADD(sega_speech_board)
diff --git a/src/mame/drivers/segas16a.cpp b/src/mame/drivers/segas16a.cpp
index be4486d08ec..4df3505e6c9 100644
--- a/src/mame/drivers/segas16a.cpp
+++ b/src/mame/drivers/segas16a.cpp
@@ -148,12 +148,12 @@ Tetris - - - - EPR12169 EPR12170 -
#include "emu.h"
#include "includes/segas16a.h"
-#include "machine/segacrp2_device.h"
+#include "includes/segaipt.h"
#include "machine/fd1089.h"
#include "machine/nvram.h"
+#include "machine/segacrp2_device.h"
#include "sound/dac.h"
-#include "includes/segaipt.h"
-
+#include "sound/volt_reg.h"
//**************************************************************************
// PPI READ/WRITE CALLBACKS
@@ -1003,7 +1003,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( n7751_portmap, AS_IO, 8, segas16a_state )
AM_RANGE(MCS48_PORT_BUS, MCS48_PORT_BUS) AM_READ(n7751_rom_r)
AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_READ(n7751_t1_r)
- AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_DEVWRITE("dac", dac_device, write_unsigned8)
+ AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_READWRITE(n7751_p2_r, n7751_p2_w)
AM_RANGE(MCS48_PORT_PROG, MCS48_PORT_PROG) AM_DEVWRITE("n7751_8243", i8243_device, i8243_prog_w)
ADDRESS_MAP_END
@@ -1930,16 +1930,17 @@ static MACHINE_CONFIG_START( system16a, segas16a_state )
MCFG_PALETTE_ADD("palette", 2048*3)
// sound hardware
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_YM2151_ADD("ymsnd", 4000000)
MCFG_YM2151_PORT_WRITE_HANDLER(WRITE8(segas16a_state, n7751_control_w))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.43)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.43)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.4) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
@@ -1979,9 +1980,10 @@ static MACHINE_CONFIG_DERIVED( system16a_no7751, system16a )
MCFG_DEVICE_REMOVE("n7751")
MCFG_DEVICE_REMOVE("dac")
+ MCFG_DEVICE_REMOVE("vref")
MCFG_SOUND_REPLACE("ymsnd", YM2151, 4000000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( system16a_no7751p, system16a_no7751 )
@@ -1996,9 +1998,10 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( system16a_i8751_no7751, system16a_i8751 )
MCFG_DEVICE_REMOVE("n7751")
MCFG_DEVICE_REMOVE("dac")
+ MCFG_DEVICE_REMOVE("vref")
MCFG_SOUND_REPLACE("ymsnd", YM2151, 4000000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
*/
@@ -2008,9 +2011,10 @@ static MACHINE_CONFIG_DERIVED( system16a_fd1089a_no7751, system16a_fd1089a )
MCFG_DEVICE_REMOVE("n7751")
MCFG_DEVICE_REMOVE("dac")
+ MCFG_DEVICE_REMOVE("vref")
MCFG_SOUND_REPLACE("ymsnd", YM2151, 4000000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( system16a_fd1089b_no7751, system16a_fd1089b )
@@ -2019,9 +2023,10 @@ static MACHINE_CONFIG_DERIVED( system16a_fd1089b_no7751, system16a_fd1089b )
MCFG_DEVICE_REMOVE("n7751")
MCFG_DEVICE_REMOVE("dac")
+ MCFG_DEVICE_REMOVE("vref")
MCFG_SOUND_REPLACE("ymsnd", YM2151, 4000000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( system16a_fd1094_no7751, system16a_fd1094 )
@@ -2030,9 +2035,10 @@ static MACHINE_CONFIG_DERIVED( system16a_fd1094_no7751, system16a_fd1094 )
MCFG_DEVICE_REMOVE("n7751")
MCFG_DEVICE_REMOVE("dac")
+ MCFG_DEVICE_REMOVE("vref")
MCFG_SOUND_REPLACE("ymsnd", YM2151, 4000000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/segas24.cpp b/src/mame/drivers/segas24.cpp
index b62cc727138..92058189954 100644
--- a/src/mame/drivers/segas24.cpp
+++ b/src/mame/drivers/segas24.cpp
@@ -336,15 +336,14 @@ Notes:
*/
#include "emu.h"
+#include "includes/segas24.h"
+#include "includes/segaipt.h"
#include "cpu/m68000/m68000.h"
-#include "sound/ym2151.h"
-#include "sound/dac.h"
-#include "sound/ym2151.h"
#include "machine/fd1094.h"
#include "machine/nvram.h"
+#include "sound/volt_reg.h"
+#include "sound/ym2151.h"
#include "video/segaic24.h"
-#include "includes/segas24.h"
-#include "includes/segaipt.h"
#define MASTER_CLOCK XTAL_20MHz
#define VIDEO_CLOCK XTAL_32MHz
@@ -604,7 +603,7 @@ void segas24_state::mahmajn_io_w(UINT8 port, UINT8 data)
cur_input_line = (cur_input_line + 1) & 7;
break;
case 7: // DAC
- m_dac->write_signed8(data);
+ m_dac->write(data);
break;
default:
fprintf(stderr, "Port %d : %02x\n", port, data & 0xff);
@@ -618,7 +617,7 @@ void segas24_state::hotrod_io_w(UINT8 port, UINT8 data)
case 3: // Lamps
break;
case 7: // DAC
- m_dac->write_signed8(data);
+ m_dac->write(data);
break;
default:
fprintf(stderr, "Port %d : %02x\n", port, data & 0xff);
@@ -2043,9 +2042,9 @@ static MACHINE_CONFIG_START( system24, segas24_state )
MCFG_SOUND_ROUTE(0, "lspeaker", 0.50)
MCFG_SOUND_ROUTE(1, "rspeaker", 0.50)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.50)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.50)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.5) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.5) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( system24_floppy, system24 )
diff --git a/src/mame/drivers/seicross.cpp b/src/mame/drivers/seicross.cpp
index 9761fb364b6..591b6c10760 100644
--- a/src/mame/drivers/seicross.cpp
+++ b/src/mame/drivers/seicross.cpp
@@ -45,13 +45,12 @@ This info came from http://www.ne.jp/asahi/cc-sakura/akkun/old/fryski.html
***************************************************************************/
#include "emu.h"
-#include "cpu/z80/z80.h"
+#include "includes/seicross.h"
#include "cpu/m6800/m6800.h"
+#include "cpu/z80/z80.h"
#include "machine/watchdog.h"
#include "sound/ay8910.h"
-#include "sound/dac.h"
-#include "includes/seicross.h"
-
+#include "sound/volt_reg.h"
void seicross_state::nvram_init(nvram_device &nvram, void *data, size_t size)
{
@@ -102,6 +101,10 @@ WRITE8_MEMBER(seicross_state::portB_w)
m_portb = data;
}
+WRITE8_MEMBER(seicross_state::dac_w)
+{
+ m_dac->write(data >> 4);
+}
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, seicross_state )
AM_RANGE(0x0000, 0x77ff) AM_ROM
@@ -127,7 +130,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( mcu_nvram_map, AS_PROGRAM, 8, seicross_state )
AM_RANGE(0x0000, 0x007f) AM_RAM
AM_RANGE(0x1000, 0x10ff) AM_RAM AM_SHARE("nvram")
- AM_RANGE(0x2000, 0x2000) AM_DEVWRITE("dac", dac_device, write_unsigned8)
+ AM_RANGE(0x2000, 0x2000) AM_WRITE(dac_w)
AM_RANGE(0x8000, 0xf7ff) AM_ROM AM_REGION("maincpu", 0)
AM_RANGE(0xf800, 0xffff) AM_RAM AM_SHARE("share1")
ADDRESS_MAP_END
@@ -137,7 +140,7 @@ static ADDRESS_MAP_START( mcu_no_nvram_map, AS_PROGRAM, 8, seicross_state )
AM_RANGE(0x1003, 0x1003) AM_READ_PORT("DSW1") /* DSW1 */
AM_RANGE(0x1005, 0x1005) AM_READ_PORT("DSW2") /* DSW2 */
AM_RANGE(0x1006, 0x1006) AM_READ_PORT("DSW3") /* DSW3 */
- AM_RANGE(0x2000, 0x2000) AM_DEVWRITE("dac", dac_device, write_unsigned8)
+ AM_RANGE(0x2000, 0x2000) AM_WRITE(dac_w)
AM_RANGE(0x8000, 0xf7ff) AM_ROM AM_REGION("maincpu", 0)
AM_RANGE(0xf800, 0xffff) AM_RAM AM_SHARE("share1")
ADDRESS_MAP_END
@@ -413,15 +416,16 @@ static MACHINE_CONFIG_START( no_nvram, seicross_state )
MCFG_PALETTE_INIT_OWNER(seicross_state, seicross)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_SOUND_ADD("aysnd", AY8910, 1536000)
MCFG_AY8910_PORT_B_READ_CB(READ8(seicross_state, portB_r))
MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(seicross_state, portB_w))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SOUND_ADD("dac", DAC_4BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.12) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/senjyo.cpp b/src/mame/drivers/senjyo.cpp
index f951a36dcd1..e0d5af33981 100644
--- a/src/mame/drivers/senjyo.cpp
+++ b/src/mame/drivers/senjyo.cpp
@@ -78,10 +78,11 @@ I/O read/write
/* 26.February 2012 Tsuyoshi Hasegawa fixed palette intensity */
#include "emu.h"
+#include "includes/senjyo.h"
#include "cpu/z80/z80.h"
-#include "sound/sn76496.h"
#include "machine/segacrpt_device.h"
-#include "includes/senjyo.h"
+#include "sound/sn76496.h"
+#include "sound/volt_reg.h"
void senjyo_state::machine_start()
{
@@ -583,19 +584,20 @@ static MACHINE_CONFIG_START( senjyo, senjyo_state )
MCFG_PALETTE_INIT_OWNER(senjyo_state, radar)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_SOUND_ADD("sn1", SN76496, 2000000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
MCFG_SOUND_ADD("sn2", SN76496, 2000000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
MCFG_SOUND_ADD("sn3", SN76496, 2000000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.05)
+ MCFG_SOUND_ADD("dac", DAC_4BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.05) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/shangkid.cpp b/src/mame/drivers/shangkid.cpp
index 8bb8482aee4..1a5adeee78b 100644
--- a/src/mame/drivers/shangkid.cpp
+++ b/src/mame/drivers/shangkid.cpp
@@ -51,10 +51,11 @@ Games by Nihon Game/Culture Brain:
*/
#include "emu.h"
+#include "includes/shangkid.h"
#include "cpu/z80/z80.h"
#include "sound/ay8910.h"
#include "sound/dac.h"
-#include "includes/shangkid.h"
+#include "sound/volt_reg.h"
/***************************************************************************************/
@@ -339,7 +340,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( sound_portmap, AS_IO, 8, shangkid_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x00, 0x00) AM_READ(soundlatch_r) AM_DEVWRITE("dac", dac_device, write_unsigned8)
+ AM_RANGE(0x00, 0x00) AM_READ(soundlatch_r) AM_DEVWRITE("dac", dac_byte_interface, write)
ADDRESS_MAP_END
/***************************************************************************************/
@@ -378,15 +379,16 @@ static MACHINE_CONFIG_START( chinhero, shangkid_state )
MCFG_VIDEO_START_OVERRIDE(shangkid_state,shangkid)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MCFG_SOUND_ADD("aysnd", AY8910, XTAL_18_432MHz/12) /* verified on pcb */
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(shangkid_state, chinhero_ay8910_porta_w))
MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(shangkid_state, ay8910_portb_w))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.1)
MACHINE_CONFIG_END
@@ -459,10 +461,10 @@ static MACHINE_CONFIG_START( dynamski, shangkid_state )
MCFG_PALETTE_INIT_OWNER(shangkid_state,dynamski)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_SOUND_ADD("aysnd", AY8910, 2000000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.1)
MACHINE_CONFIG_END
/***************************************************************************************/
diff --git a/src/mame/drivers/shisen.cpp b/src/mame/drivers/shisen.cpp
index 6954a34b2f3..7e8eba9c78f 100644
--- a/src/mame/drivers/shisen.cpp
+++ b/src/mame/drivers/shisen.cpp
@@ -9,10 +9,10 @@ driver by Nicola Salmoria
***************************************************************************/
#include "emu.h"
+#include "includes/shisen.h"
#include "cpu/z80/z80.h"
-#include "sound/dac.h"
#include "sound/ym2151.h"
-#include "includes/shisen.h"
+#include "sound/volt_reg.h"
READ8_MEMBER(shisen_state::dsw1_r)
{
@@ -241,9 +241,9 @@ static MACHINE_CONFIG_START( shisen, shisen_state )
MCFG_SOUND_ROUTE(0, "lspeaker", 0.5)
MCFG_SOUND_ROUTE(1, "rspeaker", 0.5)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.25)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.25)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.25) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.25) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/spacefb.cpp b/src/mame/drivers/spacefb.cpp
index a7641a58287..e34bd2b1b7e 100644
--- a/src/mame/drivers/spacefb.cpp
+++ b/src/mame/drivers/spacefb.cpp
@@ -244,7 +244,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( spacefb_audio_io_map, AS_IO, 8, spacefb_state )
- AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_DEVWRITE("dac", dac_device, write_unsigned8)
+ AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_READ(audio_p2_r)
AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_READ(audio_t0_r)
AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_READ(audio_t1_r)
diff --git a/src/mame/drivers/spaceg.cpp b/src/mame/drivers/spaceg.cpp
index 785d22f2de3..a2ec52d4071 100644
--- a/src/mame/drivers/spaceg.cpp
+++ b/src/mame/drivers/spaceg.cpp
@@ -164,9 +164,8 @@ Notes:
**************************************************************************************/
#include "emu.h"
+#include "includes/mw8080bw.h"
#include "cpu/z80/z80.h"
-#include "sound/dac.h"
-#include "sound/sn76496.h"
/*************************************
@@ -185,7 +184,13 @@ public:
m_io9400(*this, "io9400"),
m_io9401(*this, "io9401"),
m_maincpu(*this, "maincpu"),
- m_palette(*this, "palette") { }
+ m_palette(*this, "palette"),
+ m_samples(*this, "samples"),
+ m_sn(*this, "snsnd"),
+ m_sound1(0),
+ m_sound2(0),
+ m_sound3(0)
+ { }
required_shared_ptr<UINT8> m_colorram;
required_shared_ptr<UINT8> m_videoram;
@@ -197,8 +202,27 @@ public:
UINT32 screen_update_spaceg(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
required_device<cpu_device> m_maincpu;
required_device<palette_device> m_palette;
+ required_device<samples_device> m_samples;
+ required_device<sn76477_device> m_sn;
+
+ DECLARE_WRITE8_MEMBER(sound1_w);
+ DECLARE_WRITE8_MEMBER(sound2_w);
+ DECLARE_WRITE8_MEMBER(sound3_w);
+ uint8_t m_sound1;
+ uint8_t m_sound2;
+ uint8_t m_sound3;
+
+protected:
+ virtual void driver_start() override;
};
+void spaceg_state::driver_start()
+{
+ save_item(NAME(m_sound1));
+ save_item(NAME(m_sound2));
+ save_item(NAME(m_sound3));
+}
+
/*************************************
*
* Video emulation
@@ -327,6 +351,47 @@ UINT32 spaceg_state::screen_update_spaceg(screen_device &screen, bitmap_ind16 &b
return 0;
}
+WRITE8_MEMBER(spaceg_state::sound1_w)
+{
+ if (!BIT(m_sound1, 1) && BIT(data, 1))
+ m_samples->start(1, 1); // Death
+
+ if (!BIT(m_sound1, 2) && BIT(data, 2))
+ m_samples->start(0, 0); // Shoot
+
+ m_sn->enable_w(!(data & 0x08)); // Boss
+
+ m_sound1 = data;
+
+ if (data & ~0x0e) logerror("spaceg sound3 unmapped %02x\n", data & ~0x0e);
+}
+
+WRITE8_MEMBER(spaceg_state::sound2_w)
+{
+ // game writes 0x01 at bootup & 0x11 when you start a game
+ m_sound2 = data;
+
+ if (data & ~0x11) logerror("spaceg sound2 unmapped %02x\n", data & ~0x11);
+}
+
+WRITE8_MEMBER(spaceg_state::sound3_w)
+{
+ if (!BIT(m_sound3, 0) && BIT(data, 0))
+ m_samples->start(4, 8); // Start of level
+
+ if (!BIT(m_sound3, 1) && BIT(data, 1))
+ m_samples->start(5, 8); // Rocket
+
+ if (!BIT(m_sound3, 2) && BIT(data, 2))
+ m_samples->start(2, 2); // Hit
+
+ if (!BIT(m_sound3, 3) && BIT(data, 3))
+ m_samples->start(3, 7); // Dive bomb
+
+ m_sound3 = data;
+
+ if (data & ~0x0f) logerror("spaceg sound3 unmapped %02x\n", data & ~0x0f);
+}
/*************************************
*
@@ -350,7 +415,10 @@ static ADDRESS_MAP_START( spaceg_map, AS_PROGRAM, 8, spaceg_state )
bit 3 is probably a flip screen
bit 7 - unknown - set to 1 during the gameplay (coinlock ?)
*/
- AM_RANGE(0x9402, 0x9407) AM_RAM /* surely wrong */
+ AM_RANGE(0x9402, 0x9402) AM_WRITENOP
+ AM_RANGE(0x9405, 0x9405) AM_WRITE(sound1_w)
+ AM_RANGE(0x9406, 0x9406) AM_WRITE(sound2_w)
+ AM_RANGE(0x9407, 0x9407) AM_WRITE(sound3_w)
AM_RANGE(0x9800, 0x9800) AM_READ_PORT("9800")
AM_RANGE(0x9801, 0x9801) AM_READ_PORT("9801")
@@ -432,19 +500,7 @@ static MACHINE_CONFIG_START( spaceg, spaceg_state )
MCFG_PALETTE_INIT_OWNER(spaceg_state, spaceg)
/* sound hardware */
-// MCFG_SPEAKER_STANDARD_MONO("mono")
-
-// MCFG_SOUND_ADD("sn1", SN76496, 15468480/4)
-// MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
-
-// MCFG_SOUND_ADD("sn2", SN76496, 15468480/4)
-// MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
-
-// MCFG_SOUND_ADD("sn3", SN76496, 15468480/4)
-// MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
-
-// MCFG_DAC_ADD("dac")
-// MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_FRAGMENT_ADD(invaders_samples_audio)
MACHINE_CONFIG_END
@@ -481,4 +537,4 @@ ROM_END
*
*************************************/
-GAME( 1979, spaceg, 0, spaceg, spaceg, driver_device, 0, ROT270, "Omori Electric Co., Ltd.", "Space Guerrilla", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NO_SOUND | MACHINE_SUPPORTS_SAVE )
+GAME( 1979, spaceg, 0, spaceg, spaceg, driver_device, 0, ROT270, "Omori Electric Co., Ltd.", "Space Guerrilla", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/special.cpp b/src/mame/drivers/special.cpp
index 46a52a9ef8b..b4ce4e5ac49 100644
--- a/src/mame/drivers/special.cpp
+++ b/src/mame/drivers/special.cpp
@@ -9,8 +9,8 @@
****************************************************************************/
-
#include "includes/special.h"
+#include "sound/volt_reg.h"
#include "softlist.h"
/* Address maps */
@@ -372,11 +372,13 @@ static MACHINE_CONFIG_START( special, special_state )
MCFG_PALETTE_ADD("palette", 2)
/* audio hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("dac", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.0625)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT)
+
MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
/* Devices */
MCFG_DEVICE_ADD("ppi8255", I8255, 0)
@@ -436,7 +438,7 @@ static MACHINE_CONFIG_DERIVED( specimx, special )
/* audio hardware */
MCFG_SOUND_ADD("custom", SPECIMX_SND, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
/* Devices */
MCFG_DEVICE_ADD( "pit8253", PIT8253, 0)
@@ -489,11 +491,13 @@ static MACHINE_CONFIG_START( erik, special_state )
MCFG_PALETTE_INIT_OWNER(special_state,erik)
/* audio hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("dac", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.0625)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT)
+
MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
/* Devices */
MCFG_CASSETTE_ADD( "cassette" )
diff --git a/src/mame/drivers/ssozumo.cpp b/src/mame/drivers/ssozumo.cpp
index 1f13c6b6138..ce6287a4948 100644
--- a/src/mame/drivers/ssozumo.cpp
+++ b/src/mame/drivers/ssozumo.cpp
@@ -10,11 +10,12 @@ Driver by Takahiro Nogi (nogi@kt.rim.or.jp) 1999/10/04
***************************************************************************/
#include "emu.h"
+#include "includes/ssozumo.h"
#include "cpu/m6502/m6502.h"
#include "cpu/m6809/m6809.h"
#include "sound/ay8910.h"
#include "sound/dac.h"
-#include "includes/ssozumo.h"
+#include "sound/volt_reg.h"
void ssozumo_state::machine_start()
@@ -58,7 +59,7 @@ static ADDRESS_MAP_START( ssozumo_sound_map, AS_PROGRAM, 8, ssozumo_state )
AM_RANGE(0x0000, 0x01ff) AM_RAM
AM_RANGE(0x2000, 0x2001) AM_DEVWRITE("ay1", ay8910_device, data_address_w)
AM_RANGE(0x2002, 0x2003) AM_DEVWRITE("ay2", ay8910_device, data_address_w)
- AM_RANGE(0x2004, 0x2004) AM_DEVWRITE("dac", dac_device, write_signed8)
+ AM_RANGE(0x2004, 0x2004) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(0x2005, 0x2005) AM_WRITE(sound_nmi_mask_w)
AM_RANGE(0x2007, 0x2007) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE(0x4000, 0xffff) AM_ROM
@@ -218,18 +219,19 @@ static MACHINE_CONFIG_START( ssozumo, ssozumo_state )
MCFG_PALETTE_INIT_OWNER(ssozumo_state, ssozumo)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("ay1", AY8910, 1500000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.3)
MCFG_SOUND_ADD("ay2", AY8910, 1500000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.3)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.3) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/ssystem3.cpp b/src/mame/drivers/ssystem3.cpp
index 03240af22b5..96a26c41cce 100644
--- a/src/mame/drivers/ssystem3.cpp
+++ b/src/mame/drivers/ssystem3.cpp
@@ -39,7 +39,6 @@ backup of playfield rom and picture/description of its board
#include "includes/ssystem3.h"
#include "cpu/m6502/m6502.h"
-#include "sound/dac.h"
// in my opinion own cpu to display lcd field and to handle own buttons
@@ -304,11 +303,6 @@ static MACHINE_CONFIG_START( ssystem3, ssystem3_state )
MCFG_PALETTE_ADD("palette", 242 + 32768)
MCFG_PALETTE_INIT_OWNER(ssystem3_state, ssystem3)
- /* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("dac", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
-
/* via */
MCFG_DEVICE_ADD("via6522_0", VIA6522, 0)
MCFG_VIA6522_READPA_HANDLER(READ8(ssystem3_state,ssystem3_via_read_a))
diff --git a/src/mame/drivers/suna16.cpp b/src/mame/drivers/suna16.cpp
index e32d00c6f16..b690876c05c 100644
--- a/src/mame/drivers/suna16.cpp
+++ b/src/mame/drivers/suna16.cpp
@@ -25,12 +25,14 @@ Year + Game By Board Hardware
***************************************************************************/
#include "emu.h"
-#include "cpu/z80/z80.h"
+#include "includes/suna16.h"
#include "cpu/m68000/m68000.h"
-#include "sound/ym2151.h"
-#include "sound/ay8910.h"
+#include "cpu/z80/z80.h"
#include "sound/3526intf.h"
-#include "includes/suna16.h"
+#include "sound/ay8910.h"
+#include "sound/dac.h"
+#include "sound/volt_reg.h"
+#include "sound/ym2151.h"
/***************************************************************************
@@ -332,38 +334,19 @@ ADDRESS_MAP_END
-/* 2 DACs per CPU - 4 bits per sample */
-
-WRITE8_MEMBER(suna16_state::DAC1_w)
-{
- m_dac1->write_unsigned8( (data & 0xf) * 0x11 );
-}
-WRITE8_MEMBER(suna16_state::DAC2_w)
-{
- m_dac2->write_unsigned8( (data & 0xf) * 0x11 );
-}
-WRITE8_MEMBER(suna16_state::bssoccer_DAC3_w)
-{
- m_dac3->write_unsigned8( (data & 0xf) * 0x11 );
-}
-WRITE8_MEMBER(suna16_state::bssoccer_DAC4_w)
-{
- m_dac4->write_unsigned8( (data & 0xf) * 0x11 );
-}
-
static ADDRESS_MAP_START( bssoccer_pcm_1_io_map, AS_IO, 8, suna16_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x00) AM_DEVREAD("soundlatch2", generic_latch_8_device, read) // From The Sound Z80
- AM_RANGE(0x00, 0x00) AM_WRITE(DAC1_w) // 2 x DAC
- AM_RANGE(0x01, 0x01) AM_WRITE(DAC2_w) // 2 x DAC
+ AM_RANGE(0x00, 0x00) AM_DEVWRITE("ldac", dac_byte_interface, write)
+ AM_RANGE(0x01, 0x01) AM_DEVWRITE("rdac", dac_byte_interface, write)
AM_RANGE(0x03, 0x03) AM_WRITE(bssoccer_pcm_1_bankswitch_w) // Rom Bank
ADDRESS_MAP_END
static ADDRESS_MAP_START( bssoccer_pcm_2_io_map, AS_IO, 8, suna16_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x00) AM_DEVREAD("soundlatch3", generic_latch_8_device, read) // From The Sound Z80
- AM_RANGE(0x00, 0x00) AM_WRITE(bssoccer_DAC3_w) // 2 x DAC
- AM_RANGE(0x01, 0x01) AM_WRITE(bssoccer_DAC4_w) // 2 x DAC
+ AM_RANGE(0x00, 0x00) AM_DEVWRITE("ldac2", dac_byte_interface, write)
+ AM_RANGE(0x01, 0x01) AM_DEVWRITE("rdac2", dac_byte_interface, write)
AM_RANGE(0x03, 0x03) AM_WRITE(bssoccer_pcm_2_bankswitch_w) // Rom Bank
ADDRESS_MAP_END
@@ -391,8 +374,8 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( uballoon_pcm_1_io_map, AS_IO, 8, suna16_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x00) AM_DEVREAD("soundlatch2", generic_latch_8_device, read) // From The Sound Z80
- AM_RANGE(0x00, 0x00) AM_WRITE(DAC1_w) // 2 x DAC
- AM_RANGE(0x01, 0x01) AM_WRITE(DAC2_w) // 2 x DAC
+ AM_RANGE(0x00, 0x00) AM_DEVWRITE("ldac", dac_byte_interface, write)
+ AM_RANGE(0x01, 0x01) AM_DEVWRITE("rdac", dac_byte_interface, write)
AM_RANGE(0x03, 0x03) AM_WRITE(uballoon_pcm_1_bankswitch_w) // Rom Bank
ADDRESS_MAP_END
@@ -421,8 +404,10 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( bestbest_pcm_1_iomap, AS_IO, 8, suna16_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x00) AM_DEVREAD("soundlatch2", generic_latch_8_device, read) // From The Sound Z80
- AM_RANGE(0x00, 0x00) AM_MIRROR(0x02) AM_WRITE(DAC1_w) // 2 x DAC
- AM_RANGE(0x01, 0x01) AM_MIRROR(0x02) AM_WRITE(DAC2_w) // 2 x DAC
+ AM_RANGE(0x00, 0x00) AM_DEVWRITE("ldac", dac_byte_interface, write)
+ AM_RANGE(0x01, 0x01) AM_DEVWRITE("rdac", dac_byte_interface, write)
+ AM_RANGE(0x02, 0x02) AM_DEVWRITE("ldac2", dac_byte_interface, write)
+ AM_RANGE(0x03, 0x03) AM_DEVWRITE("rdac2", dac_byte_interface, write)
ADDRESS_MAP_END
/***************************************************************************
@@ -851,20 +836,18 @@ static MACHINE_CONFIG_START( bssoccer, suna16_state )
MCFG_GENERIC_LATCH_8_ADD("soundlatch3")
MCFG_YM2151_ADD("ymsnd", XTAL_14_31818MHz/4) /* 3.579545MHz */
- MCFG_SOUND_ROUTE(0, "lspeaker", 0.20)
- MCFG_SOUND_ROUTE(1, "rspeaker", 0.20)
-
- MCFG_DAC_ADD("dac1")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.40)
-
- MCFG_DAC_ADD("dac2")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.40)
-
- MCFG_DAC_ADD("dac3")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.40)
-
- MCFG_DAC_ADD("dac4")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.40)
+ MCFG_SOUND_ROUTE(0, "lspeaker", 0.2)
+ MCFG_SOUND_ROUTE(1, "rspeaker", 0.2)
+
+ MCFG_SOUND_ADD("ldac", DAC_4BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.2) // unknown DAC
+ MCFG_SOUND_ADD("rdac", DAC_4BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.2) // unknown DAC
+ MCFG_SOUND_ADD("ldac2", DAC_4BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.2) // unknown DAC
+ MCFG_SOUND_ADD("rdac2", DAC_4BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.2) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "ldac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "ldac", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "rdac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "rdac", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "ldac2", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "ldac2", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "rdac2", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "rdac2", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
@@ -917,11 +900,11 @@ static MACHINE_CONFIG_START( uballoon, suna16_state )
MCFG_SOUND_ROUTE(0, "lspeaker", 0.50)
MCFG_SOUND_ROUTE(1, "rspeaker", 0.50)
- MCFG_DAC_ADD("dac1")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.50)
-
- MCFG_DAC_ADD("dac2")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.50)
+ MCFG_SOUND_ADD("ldac", DAC_4BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.25) // unknown DAC
+ MCFG_SOUND_ADD("rdac", DAC_4BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.25) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "ldac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "ldac", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "rdac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "rdac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
/***************************************************************************
@@ -973,11 +956,11 @@ static MACHINE_CONFIG_START( sunaq, suna16_state )
MCFG_SOUND_ROUTE(0, "lspeaker", 0.50)
MCFG_SOUND_ROUTE(1, "rspeaker", 0.50)
- MCFG_DAC_ADD("dac1")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.50)
-
- MCFG_DAC_ADD("dac2")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.50)
+ MCFG_SOUND_ADD("ldac", DAC_4BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.25) // unknown DAC
+ MCFG_SOUND_ADD("rdac", DAC_4BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.25) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "ldac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "ldac", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "rdac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "rdac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
/***************************************************************************
@@ -1038,17 +1021,15 @@ static MACHINE_CONFIG_START( bestbest, suna16_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
- MCFG_DAC_ADD("dac1")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.40)
-
- MCFG_DAC_ADD("dac2")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.40)
-
- MCFG_DAC_ADD("dac3")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.40)
-
- MCFG_DAC_ADD("dac4")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.40)
+ MCFG_SOUND_ADD("ldac", DAC_4BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.2) // unknown DAC
+ MCFG_SOUND_ADD("rdac", DAC_4BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.2) // unknown DAC
+ MCFG_SOUND_ADD("ldac2", DAC_4BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.2) // unknown DAC
+ MCFG_SOUND_ADD("rdac2", DAC_4BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.2) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "ldac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "ldac", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "rdac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "rdac", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "ldac2", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "ldac2", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "rdac2", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "rdac2", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
/***************************************************************************
diff --git a/src/mame/drivers/suna8.cpp b/src/mame/drivers/suna8.cpp
index 9c129a5174a..114ab90e917 100644
--- a/src/mame/drivers/suna8.cpp
+++ b/src/mame/drivers/suna8.cpp
@@ -8,7 +8,7 @@
Main CPU: Encrypted Z80 (Epoxy Module)
-Sound CPU: Z80 [Music] + Z80 [8 Bit PCM, Optional]
+Sound CPU: Z80 [Music] + Z80 [4 Bit PCM, Optional]
Sound Chips: AY8910 + YM3812/YM2203 + DAC x 4 [Optional] + Samples [Optional]
@@ -36,13 +36,14 @@ Notes:
***************************************************************************/
#include "emu.h"
+#include "includes/suna8.h"
#include "cpu/z80/z80.h"
#include "machine/watchdog.h"
-#include "sound/ay8910.h"
#include "sound/2203intf.h"
#include "sound/3812intf.h"
+#include "sound/ay8910.h"
#include "sound/dac.h"
-#include "includes/suna8.h"
+#include "sound/volt_reg.h"
#define SUNA8_MASTER_CLOCK XTAL_24MHz
@@ -1307,17 +1308,13 @@ static ADDRESS_MAP_START( brickzn_pcm_map, AS_PROGRAM, 8, suna8_state )
ADDRESS_MAP_END
-WRITE8_MEMBER(suna8_state::brickzn_pcm_w)
-{
- static const char *const dacs[] = { "dac1", "dac2", "dac3", "dac4" };
- machine().device<dac_device>(dacs[offset & 3])->write_signed8( (data & 0xf) * 0x11 );
-}
-
-
static ADDRESS_MAP_START( brickzn_pcm_io_map, AS_IO, 8, suna8_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x00) AM_DEVREAD("soundlatch2", generic_latch_8_device, read) // From Sound CPU
- AM_RANGE(0x00, 0x03) AM_WRITE(brickzn_pcm_w ) // 4 x DAC
+ AM_RANGE(0x00, 0x00) AM_DEVWRITE("ldac", dac_byte_interface, write)
+ AM_RANGE(0x01, 0x01) AM_DEVWRITE("rdac", dac_byte_interface, write)
+ AM_RANGE(0x02, 0x02) AM_DEVWRITE("ldac2", dac_byte_interface, write)
+ AM_RANGE(0x03, 0x03) AM_DEVWRITE("rdac2", dac_byte_interface, write)
ADDRESS_MAP_END
/***************************************************************************
@@ -1898,23 +1895,23 @@ static MACHINE_CONFIG_START( hardhead, suna8_state )
MCFG_VIDEO_START_OVERRIDE(suna8_state,suna8_text)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
MCFG_SOUND_ADD("ymsnd", YM3812, SUNA8_MASTER_CLOCK / 8) /* verified on pcb */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MCFG_SOUND_ADD("aysnd", AY8910, SUNA8_MASTER_CLOCK / 16) /* verified on pcb */
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(suna8_state, suna8_play_samples_w))
MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(suna8_state, suna8_samples_number_w))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.3)
MCFG_SOUND_ADD("samples", SAMPLES, 0)
MCFG_SAMPLES_CHANNELS(1)
MCFG_SAMPLES_START_CB(suna8_state, sh_start)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
MACHINE_CONFIG_END
@@ -1957,7 +1954,7 @@ static MACHINE_CONFIG_START( rranger, suna8_state )
MCFG_VIDEO_START_OVERRIDE(suna8_state,suna8_text)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
@@ -1965,15 +1962,15 @@ static MACHINE_CONFIG_START( rranger, suna8_state )
MCFG_SOUND_ADD("ym1", YM2203, SUNA8_MASTER_CLOCK / 16) /* verified on pcb */
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(suna8_state, rranger_play_samples_w))
MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(suna8_state, suna8_samples_number_w))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.9)
MCFG_SOUND_ADD("ym2", YM2203, SUNA8_MASTER_CLOCK / 16) /* verified on pcb */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.9)
MCFG_SOUND_ADD("samples", SAMPLES, 0)
MCFG_SAMPLES_CHANNELS(1)
MCFG_SAMPLES_START_CB(suna8_state, sh_start)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
MACHINE_CONFIG_END
@@ -2026,29 +2023,27 @@ static MACHINE_CONFIG_START( brickzn11, suna8_state )
MCFG_VIDEO_START_OVERRIDE(suna8_state,suna8_brickzn)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
MCFG_SOUND_ADD("ymsnd", YM3812, SUNA8_MASTER_CLOCK / 8) // 3MHz (measured)
MCFG_YM3812_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MCFG_SOUND_ADD("aysnd", AY8910, SUNA8_MASTER_CLOCK / 16) // 1.5MHz (measured)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33)
-
- MCFG_DAC_ADD("dac1")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.17)
-
- MCFG_DAC_ADD("dac2")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.17)
-
- MCFG_DAC_ADD("dac3")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.17)
-
- MCFG_DAC_ADD("dac4")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.17)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.33)
+
+ MCFG_SOUND_ADD("ldac", DAC_4BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.17) // unknown DAC
+ MCFG_SOUND_ADD("rdac", DAC_4BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.17) // unknown DAC
+ MCFG_SOUND_ADD("ldac2", DAC_4BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.17) // unknown DAC
+ MCFG_SOUND_ADD("rdac2", DAC_4BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.17) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "ldac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "ldac", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "rdac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "rdac", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "ldac2", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "ldac2", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "rdac2", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "rdac2", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( brickzn, brickzn11 )
@@ -2139,23 +2134,23 @@ static MACHINE_CONFIG_START( starfigh, suna8_state )
MCFG_VIDEO_START_OVERRIDE(suna8_state,suna8_starfigh)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
MCFG_SOUND_ADD("ymsnd", YM3812, SUNA8_MASTER_CLOCK / 8)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MCFG_SOUND_ADD("aysnd", AY8910, SUNA8_MASTER_CLOCK / 16)
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(suna8_state, suna8_play_samples_w))
MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(suna8_state, suna8_samples_number_w))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
MCFG_SOUND_ADD("samples", SAMPLES, 0)
MCFG_SAMPLES_CHANNELS(1)
MCFG_SAMPLES_START_CB(suna8_state, sh_start)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
MACHINE_CONFIG_END
@@ -2193,23 +2188,23 @@ static MACHINE_CONFIG_START( sparkman, suna8_state )
MCFG_VIDEO_START_OVERRIDE(suna8_state,suna8_sparkman)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
MCFG_SOUND_ADD("ymsnd", YM3812, SUNA8_MASTER_CLOCK / 8)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MCFG_SOUND_ADD("aysnd", AY8910, SUNA8_MASTER_CLOCK / 16)
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(suna8_state, suna8_play_samples_w)) // two sample roms
MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(suna8_state, suna8_samples_number_w))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.3)
MCFG_SOUND_ADD("samples", SAMPLES, 0)
MCFG_SAMPLES_CHANNELS(1)
MCFG_SAMPLES_START_CB(suna8_state, sh_start)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/tagteam.cpp b/src/mame/drivers/tagteam.cpp
index dab1d7a459c..cc593cfd304 100644
--- a/src/mame/drivers/tagteam.cpp
+++ b/src/mame/drivers/tagteam.cpp
@@ -27,11 +27,11 @@ TODO:
***************************************************************************/
#include "emu.h"
+#include "includes/tagteam.h"
#include "cpu/m6502/m6502.h"
#include "sound/ay8910.h"
#include "sound/dac.h"
-#include "includes/tagteam.h"
-
+#include "sound/volt_reg.h"
void tagteam_state::machine_start()
{
@@ -73,7 +73,7 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, tagteam_state )
AM_RANGE(0x0000, 0x03ff) AM_RAM
AM_RANGE(0x2000, 0x2001) AM_DEVWRITE("ay1", ay8910_device, data_address_w)
AM_RANGE(0x2002, 0x2003) AM_DEVWRITE("ay2", ay8910_device, data_address_w)
- AM_RANGE(0x2004, 0x2004) AM_DEVWRITE("dac", dac_device, write_unsigned8)
+ AM_RANGE(0x2004, 0x2004) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(0x2005, 0x2005) AM_WRITE(sound_nmi_mask_w)
AM_RANGE(0x2007, 0x2007) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
AM_RANGE(0x4000, 0xffff) AM_ROM
@@ -234,18 +234,19 @@ static MACHINE_CONFIG_START( tagteam, tagteam_state )
MCFG_PALETTE_INIT_OWNER(tagteam_state, tagteam)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("ay1", AY8910, XTAL_12MHz/8)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
MCFG_SOUND_ADD("ay2", AY8910, XTAL_12MHz/8)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/taito.cpp b/src/mame/drivers/taito.cpp
index d079a1ddf9f..80149f34436 100644
--- a/src/mame/drivers/taito.cpp
+++ b/src/mame/drivers/taito.cpp
@@ -41,13 +41,15 @@ ToDO:
*****************************************************************************************/
-#include "machine/genpin.h"
+#include "emu.h"
#include "cpu/i8085/i8085.h"
#include "cpu/m6800/m6800.h"
#include "machine/6821pia.h"
+#include "machine/genpin.h"
#include "sound/ay8910.h"
-#include "sound/votrax.h"
#include "sound/dac.h"
+#include "sound/votrax.h"
+#include "sound/volt_reg.h"
#include "taito.lh"
class taito_state : public genpin_class
@@ -332,13 +334,14 @@ static MACHINE_CONFIG_START( taito, taito_state )
/* Sound */
MCFG_FRAGMENT_ADD( genpin_audio )
- MCFG_SPEAKER_STANDARD_MONO("dacsnd")
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "dacsnd", 0.95)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.475) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MCFG_DEVICE_ADD("pia", PIA6821, 0)
//MCFG_PIA_READPA_HANDLER(READ8(taito_state, pia_pa_r))
- MCFG_PIA_WRITEPA_HANDLER(DEVWRITE8("dac", dac_device, write_unsigned8))
+ MCFG_PIA_WRITEPA_HANDLER(DEVWRITE8("dac", dac_byte_interface, write))
MCFG_PIA_READPB_HANDLER(READ8(taito_state, pia_pb_r))
MCFG_PIA_WRITEPB_HANDLER(WRITE8(taito_state, pia_pb_w))
//MCFG_PIA_CA2_HANDLER(WRITELINE(taito_state, pia_ca2_w))
@@ -368,16 +371,8 @@ static MACHINE_CONFIG_DERIVED( taito4, taito )
MCFG_VOTRAX_SC01_REQUEST_CB(WRITELINE(taito_state, votrax_request))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "voxsnd", 0.15) // todo: fix - it makes noise continuously
- MCFG_DEVICE_REMOVE("pia")
- MCFG_DEVICE_ADD("pia", PIA6821, 0)
- //MCFG_PIA_READPA_HANDLER(READ8(taito_state, pia_pa_r))
- MCFG_PIA_WRITEPA_HANDLER(DEVWRITE8("dac", dac_device, write_unsigned8))
- MCFG_PIA_READPB_HANDLER(READ8(taito_state, pia_pb_r))
- MCFG_PIA_WRITEPB_HANDLER(WRITE8(taito_state, pia_pb_w))
- //MCFG_PIA_CA2_HANDLER(WRITELINE(taito_state, pia_ca2_w))
+ MCFG_DEVICE_MODIFY("pia")
MCFG_PIA_CB2_HANDLER(WRITELINE(taito_state, pia_cb2_w))
- MCFG_PIA_IRQA_HANDLER(INPUTLINE("audiocpu", INPUT_LINE_NMI))
- MCFG_PIA_IRQB_HANDLER(INPUTLINE("audiocpu", M6802_IRQ_LINE))
MACHINE_CONFIG_END
static MACHINE_CONFIG_FRAGMENT( taito_ay_audio )
diff --git a/src/mame/drivers/taitosj.cpp b/src/mame/drivers/taitosj.cpp
index 04a5f702d32..73ec4835d65 100644
--- a/src/mame/drivers/taitosj.cpp
+++ b/src/mame/drivers/taitosj.cpp
@@ -166,10 +166,10 @@ TODO:
***************************************************************************/
#include "emu.h"
+#include "includes/taitosj.h"
#include "cpu/z80/z80.h"
#include "cpu/m6805/m6805.h"
#include "machine/watchdog.h"
-#include "includes/taitosj.h"
WRITE8_MEMBER(taitosj_state::taitosj_sndnmi_msk_w)
@@ -1726,38 +1726,25 @@ static GFXDECODE_START( taitosj )
GFXDECODE_ENTRY( nullptr, 0xa800, spritelayout, 0, 8 ) /* the game dynamically modifies this */
GFXDECODE_END
-
-static const UINT8 voltable[256] =
+static const discrete_dac_r1_ladder taitosj_dacvol_ladder =
{
- 0xff,0xfe,0xfc,0xfb,0xf9,0xf7,0xf6,0xf4,0xf3,0xf2,0xf1,0xef,0xee,0xec,0xeb,0xea,
- 0xe8,0xe7,0xe5,0xe4,0xe2,0xe1,0xe0,0xdf,0xde,0xdd,0xdc,0xdb,0xd9,0xd8,0xd7,0xd6,
- 0xd5,0xd4,0xd3,0xd2,0xd1,0xd0,0xcf,0xce,0xcd,0xcc,0xcb,0xca,0xc9,0xc8,0xc7,0xc6,
- 0xc5,0xc4,0xc3,0xc2,0xc1,0xc0,0xbf,0xbf,0xbe,0xbd,0xbc,0xbb,0xba,0xba,0xb9,0xb8,
- 0xb7,0xb7,0xb6,0xb5,0xb4,0xb3,0xb3,0xb2,0xb1,0xb1,0xb0,0xaf,0xae,0xae,0xad,0xac,
- 0xab,0xaa,0xaa,0xa9,0xa8,0xa8,0xa7,0xa6,0xa6,0xa5,0xa5,0xa4,0xa3,0xa2,0xa2,0xa1,
- 0xa1,0xa0,0xa0,0x9f,0x9e,0x9e,0x9d,0x9d,0x9c,0x9c,0x9b,0x9b,0x9a,0x99,0x99,0x98,
- 0x97,0x97,0x96,0x96,0x95,0x95,0x94,0x94,0x93,0x93,0x92,0x92,0x91,0x91,0x90,0x90,
- 0x8b,0x8b,0x8a,0x8a,0x89,0x89,0x89,0x88,0x88,0x87,0x87,0x87,0x86,0x86,0x85,0x85,
- 0x84,0x84,0x83,0x83,0x82,0x82,0x82,0x81,0x81,0x81,0x80,0x80,0x7f,0x7f,0x7f,0x7e,
- 0x7e,0x7e,0x7d,0x7d,0x7c,0x7c,0x7c,0x7b,0x7b,0x7b,0x7a,0x7a,0x7a,0x79,0x79,0x79,
- 0x78,0x78,0x77,0x77,0x77,0x76,0x76,0x76,0x75,0x75,0x75,0x74,0x74,0x74,0x73,0x73,
- 0x73,0x73,0x72,0x72,0x72,0x71,0x71,0x71,0x70,0x70,0x70,0x70,0x6f,0x6f,0x6f,0x6e,
- 0x6e,0x6e,0x6d,0x6d,0x6d,0x6c,0x6c,0x6c,0x6c,0x6b,0x6b,0x6b,0x6b,0x6a,0x6a,0x6a,
- 0x6a,0x69,0x69,0x69,0x68,0x68,0x68,0x68,0x68,0x67,0x67,0x67,0x66,0x66,0x66,0x66,
- 0x65,0x65,0x65,0x65,0x64,0x64,0x64,0x64,0x64,0x63,0x63,0x63,0x63,0x62,0x62,0x62,
+ 8, // size of ladder
+ { RES_K(680), RES_K(330), RES_K(150), RES_K(82), RES_K(39), RES_K(20), RES_K(10), RES_K(4.7) },
+ 0,
+ 0, // no rBias
+ 0, // no rGnd
+ 0 // no cap
};
+DISCRETE_SOUND_START(taitosj_dacvol)
+ DISCRETE_INPUT_DATA(NODE_01)
+ DISCRETE_DAC_R1(NODE_02, NODE_01, DEFAULT_TTL_V_LOGIC_1, &taitosj_dacvol_ladder)
+ DISCRETE_OUTPUT(NODE_02, 9637)
+DISCRETE_SOUND_END
-WRITE8_MEMBER(taitosj_state::dac_out_w)
-{
- m_dac_out = data - 0x80;
- m_dac->write_signed16(m_dac_out * m_dac_vol + 0x8000);
-}
-
-WRITE8_MEMBER(taitosj_state::dac_vol_w)
+WRITE8_MEMBER(taitosj_state::taitosj_dacvol_w)
{
- m_dac_vol = voltable[data];
- m_dac->write_signed16(m_dac_out * m_dac_vol + 0x8000);
+ m_dacvol->write(space, NODE_01, data ^ 0xff); // 7416 hex inverter
}
static MACHINE_CONFIG_START( nomcu, taitosj_state )
@@ -1790,25 +1777,25 @@ static MACHINE_CONFIG_START( nomcu, taitosj_state )
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("ay1", AY8910, XTAL_6MHz/4) // 6mhz/4 on GAME board, AY-3-8910 @ IC53 (this is the only AY which uses proper mixing resistors, the 3 below have outputs tied together)
MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW2"))
MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSW3"))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.15)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.15)
MCFG_SOUND_ADD("ay2", AY8910, XTAL_6MHz/4) // 6mhz/4 on GAME board, AY-3-8910 @ IC51
MCFG_AY8910_OUTPUT_TYPE(AY8910_SINGLE_OUTPUT)
- MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(taitosj_state, dac_out_w)) /* port Awrite */
- MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(taitosj_state, dac_vol_w)) /* port Bwrite */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.15)
+ MCFG_AY8910_PORT_A_WRITE_CB(DEVWRITE8("dac", dac_byte_interface, write))
+ MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(taitosj_state, taitosj_dacvol_w))
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.15)
MCFG_SOUND_ADD("ay3", AY8910, XTAL_6MHz/4) // 6mhz/4 on GAME board, AY-3-8910 @ IC49
MCFG_AY8910_OUTPUT_TYPE(AY8910_SINGLE_OUTPUT)
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(taitosj_state, input_port_4_f0_w))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.15)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.15)
MCFG_SOUND_ADD("ay4", AY8910, XTAL_6MHz/4) // 6mhz/4 on GAME board, AY-3-8910 @ IC50
MCFG_AY8910_OUTPUT_TYPE(AY8910_SINGLE_OUTPUT)
@@ -1819,13 +1806,14 @@ static MACHINE_CONFIG_START( nomcu, taitosj_state )
Bio Attack uses this?
*/
MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(taitosj_state, taitosj_sndnmi_msk_w)) /* port Bwrite */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.3)
MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_VBLANK_INIT("screen", 128); // 74LS393 on CPU board, counts 128 vblanks before firing watchdog
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.2) // 30k r-2r network
+ MCFG_SOUND_ADD("dacvol", DISCRETE, 0) MCFG_DISCRETE_INTF(taitosj_dacvol)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
@@ -2790,8 +2778,6 @@ void taitosj_state::reset_common()
/* start in 1st gear */
m_kikstart_gears[0] = 0x02;
m_kikstart_gears[1] = 0x02;
- m_dac_out = 0;
- m_dac_vol = 0;
}
void taitosj_state::init_common()
@@ -2801,8 +2787,6 @@ void taitosj_state::init_common()
save_item(NAME(m_sound_semaphore));
save_item(NAME(m_input_port_4_f0));
save_item(NAME(m_kikstart_gears));
- save_item(NAME(m_dac_out));
- save_item(NAME(m_dac_vol));
machine().add_notifier(MACHINE_NOTIFY_RESET, machine_notify_delegate(FUNC(taitosj_state::reset_common), this));
}
diff --git a/src/mame/drivers/tceptor.cpp b/src/mame/drivers/tceptor.cpp
index 84eeae9edbe..f2100692abc 100644
--- a/src/mame/drivers/tceptor.cpp
+++ b/src/mame/drivers/tceptor.cpp
@@ -9,15 +9,17 @@
*/
#include "emu.h"
+#include "includes/tceptor.h"
#include "cpu/m6502/m65c02.h"
#include "cpu/m6809/m6809.h"
#include "cpu/m6800/m6800.h"
#include "cpu/m68000/m68000.h"
+#include "machine/nvram.h"
+#include "sound/dac.h"
#include "sound/ym2151.h"
+#include "sound/volt_reg.h"
#include "rendlay.h"
#include "tceptor2.lh"
-#include "includes/tceptor.h"
-#include "machine/nvram.h"
/*******************************************************************/
@@ -85,12 +87,6 @@ WRITE8_MEMBER(tceptor_state::mcu_irq_disable_w)
}
-WRITE8_MEMBER(tceptor_state::voice_w)
-{
- m_dac->write_signed16(data ? (data + 1) * 0x100 : 0x8000);
-}
-
-
/* fix dsw/input data to memory mapped data */
UINT8 tceptor_state::fix_input0(UINT8 in1, UINT8 in2)
{
@@ -186,7 +182,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( m6502_b_map, AS_PROGRAM, 8, tceptor_state )
AM_RANGE(0x0000, 0x00ff) AM_RAM AM_SHARE("share2")
AM_RANGE(0x0100, 0x01ff) AM_RAM
- AM_RANGE(0x4000, 0x4000) AM_WRITE(voice_w) // voice data
+ AM_RANGE(0x4000, 0x4000) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(0x5000, 0x5000) AM_WRITEONLY // voice ctrl??
AM_RANGE(0x8000, 0xffff) AM_ROM
ADDRESS_MAP_END
@@ -422,9 +418,9 @@ static MACHINE_CONFIG_START( tceptor, tceptor_state )
MCFG_SOUND_ROUTE(0, "lspeaker", 0.40)
MCFG_SOUND_ROUTE(1, "rspeaker", 0.40)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.40)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.40)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.4) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.4) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/terracre.cpp b/src/mame/drivers/terracre.cpp
index 9bf4104be33..ef7874db697 100644
--- a/src/mame/drivers/terracre.cpp
+++ b/src/mame/drivers/terracre.cpp
@@ -81,12 +81,13 @@ AT-2
*/
#include "emu.h"
+#include "includes/terracre.h"
#include "cpu/m68000/m68000.h"
#include "cpu/z80/z80.h"
-#include "sound/dac.h"
#include "sound/2203intf.h"
#include "sound/3526intf.h"
-#include "includes/terracre.h"
+#include "sound/dac.h"
+#include "sound/volt_reg.h"
static const UINT16 mAmazonProtData[] =
@@ -222,8 +223,8 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( sound_3526_io_map, AS_IO, 8, terracre_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x01) AM_DEVWRITE("ymsnd", ym3526_device, write)
- AM_RANGE(0x02, 0x02) AM_DEVWRITE("dac1", dac_device, write_signed8)
- AM_RANGE(0x03, 0x03) AM_DEVWRITE("dac2", dac_device, write_signed8)
+ AM_RANGE(0x02, 0x02) AM_DEVWRITE("dac1", dac_byte_interface, write)
+ AM_RANGE(0x03, 0x03) AM_DEVWRITE("dac2", dac_byte_interface, write)
AM_RANGE(0x04, 0x04) AM_READ(soundlatch_clear_r)
AM_RANGE(0x06, 0x06) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
ADDRESS_MAP_END
@@ -231,8 +232,8 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( sound_2203_io_map, AS_IO, 8, terracre_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x01) AM_DEVWRITE("ym1", ym2203_device, write)
- AM_RANGE(0x02, 0x02) AM_DEVWRITE("dac1", dac_device, write_signed8)
- AM_RANGE(0x03, 0x03) AM_DEVWRITE("dac2", dac_device, write_signed8)
+ AM_RANGE(0x02, 0x02) AM_DEVWRITE("dac1", dac_byte_interface, write)
+ AM_RANGE(0x03, 0x03) AM_DEVWRITE("dac2", dac_byte_interface, write)
AM_RANGE(0x04, 0x04) AM_READ(soundlatch_clear_r)
AM_RANGE(0x06, 0x06) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
ADDRESS_MAP_END
@@ -539,19 +540,19 @@ static MACHINE_CONFIG_START( ym3526, terracre_state )
MCFG_PALETTE_INDIRECT_ENTRIES(256)
MCFG_PALETTE_INIT_OWNER(terracre_state, terracre)
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("ymsnd", YM3526, XTAL_16MHz/4)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
-
- MCFG_DAC_ADD("dac1")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
- MCFG_DAC_ADD("dac2")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
-MACHINE_CONFIG_END
+ MCFG_SOUND_ADD("dac1", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) // unknown DAC
+ MCFG_SOUND_ADD("dac2", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac1", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac1", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac2", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac2", -1.0, DAC_VREF_NEG_INPUT)
+ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( ym2203, ym3526 )
MCFG_CPU_MODIFY("audiocpu")
@@ -560,10 +561,10 @@ static MACHINE_CONFIG_DERIVED( ym2203, ym3526 )
MCFG_DEVICE_REMOVE("ymsnd")
MCFG_SOUND_ADD("ym1", YM2203, XTAL_16MHz/4)
- MCFG_SOUND_ROUTE(0, "mono", 0.20)
- MCFG_SOUND_ROUTE(1, "mono", 0.20)
- MCFG_SOUND_ROUTE(2, "mono", 0.20)
- MCFG_SOUND_ROUTE(3, "mono", 0.40)
+ MCFG_SOUND_ROUTE(0, "speaker", 0.2)
+ MCFG_SOUND_ROUTE(1, "speaker", 0.2)
+ MCFG_SOUND_ROUTE(2, "speaker", 0.2)
+ MCFG_SOUND_ROUTE(3, "speaker", 0.4)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( amazon, ym3526 )
diff --git a/src/mame/drivers/thomson.cpp b/src/mame/drivers/thomson.cpp
index 75027cdfecb..1fed3eb538a 100644
--- a/src/mame/drivers/thomson.cpp
+++ b/src/mame/drivers/thomson.cpp
@@ -77,15 +77,16 @@
*/
#include "includes/thomson.h"
-#include "bus/rs232/rs232.h"
-#include "machine/6821pia.h"
-#include "machine/wd_fdc.h"
-#include "machine/clock.h"
#include "bus/centronics/ctronics.h"
-#include "imagedev/flopdrv.h"
+#include "bus/rs232/rs232.h"
#include "formats/cd90_640_dsk.h"
#include "formats/basicdsk.h"
+#include "imagedev/flopdrv.h"
+#include "machine/6821pia.h"
+#include "machine/clock.h"
#include "machine/ram.h"
+#include "machine/wd_fdc.h"
+#include "sound/volt_reg.h"
#include "softlist.h"
@@ -635,13 +636,16 @@ static MACHINE_CONFIG_START( to7, thomson_state )
MCFG_VIDEO_START_OVERRIDE( thomson_state, thom )
/* sound */
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD ( "buzzer", DAC, 0 )
- MCFG_SOUND_ROUTE( ALL_OUTPUTS, "mono", 1.) /* 1-bit buzzer */
- MCFG_SOUND_ADD ( "dac", DAC, 0 )
- MCFG_SOUND_ROUTE( ALL_OUTPUTS, "mono", 1.) /* 6-bit game extention DAC */
- MCFG_SOUND_ADD ( "speech", DAC, 0 )
- MCFG_SOUND_ROUTE( ALL_OUTPUTS, "mono", 1.) /* speech synthesis */
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("buzzer", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5)
+ MCFG_SOUND_ADD("dac", DAC_6BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) // unknown DAC (6-bit game extension DAC)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "buzzer", 1.0, DAC_VREF_POS_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
+
+/* speech synthesis */
+ MCFG_SOUND_ADD("mea8000", MEA8000, 3840000)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
/* cassette */
MCFG_CASSETTE_ADD( "cassette" )
@@ -652,15 +656,11 @@ static MACHINE_CONFIG_START( to7, thomson_state )
/* timer */
MCFG_DEVICE_ADD("mc6846", MC6846, 0)
MCFG_MC6846_OUT_PORT_CB(WRITE8(thomson_state, to7_timer_port_out))
- MCFG_MC6846_OUT_CP2_CB(WRITE8(thomson_state, to7_timer_cp2_out))
+ MCFG_MC6846_OUT_CP2_CB(DEVWRITELINE("buzzer", dac_bit_interface, write))
MCFG_MC6846_IN_PORT_CB(READ8(thomson_state, to7_timer_port_in))
- MCFG_MC6846_OUT_CTO_CB(WRITE8(thomson_state, to7_timer_tco_out))
+ MCFG_MC6846_OUT_CTO_CB(WRITELINE(thomson_state, to7_set_cassette))
MCFG_MC6846_IRQ_CB(WRITELINE(thomson_state, thom_dev_irq_0))
-/* speech synthesis */
- MCFG_DEVICE_ADD("mea8000", MEA8000, 0)
- MCFG_MEA8000_DAC("speech")
-
/* floppy */
MCFG_DEVICE_ADD("mc6843", MC6843, 0)
@@ -1122,7 +1122,7 @@ static MACHINE_CONFIG_DERIVED( mo5, to7 )
MCFG_PIA_READPA_HANDLER(READ8(thomson_state, mo5_sys_porta_in))
MCFG_PIA_READPB_HANDLER(READ8(thomson_state, mo5_sys_portb_in))
MCFG_PIA_WRITEPA_HANDLER(WRITE8(thomson_state, mo5_sys_porta_out))
- MCFG_PIA_WRITEPB_HANDLER(WRITE8(thomson_state, mo5_sys_portb_out))
+ MCFG_PIA_WRITEPB_HANDLER(DEVWRITE8("buzzer", dac_bit_interface, write))
MCFG_PIA_CA2_HANDLER(WRITELINE(thomson_state, mo5_set_cassette_motor))
MCFG_PIA_CB2_HANDLER(NOOP)
MCFG_PIA_IRQB_HANDLER(WRITELINE(thomson_state, thom_irq_1)) /* WARNING: differs from TO7 ! */
@@ -1704,7 +1704,7 @@ static MACHINE_CONFIG_DERIVED( to8, to7 )
MCFG_DEVICE_MODIFY("mc6846")
MCFG_MC6846_OUT_PORT_CB(WRITE8(thomson_state, to8_timer_port_out))
- MCFG_MC6846_OUT_CP2_CB(WRITE8(thomson_state, to8_timer_cp2_out))
+ MCFG_MC6846_OUT_CP2_CB(WRITELINE(thomson_state, to8_timer_cp2_out))
MCFG_MC6846_IN_PORT_CB(READ8(thomson_state, to8_timer_port_in))
/* internal ram */
@@ -1868,7 +1868,7 @@ static MACHINE_CONFIG_DERIVED( to9p, to7 )
MCFG_DEVICE_MODIFY("mc6846")
MCFG_MC6846_OUT_PORT_CB(WRITE8(thomson_state, to9p_timer_port_out))
- MCFG_MC6846_OUT_CP2_CB(WRITE8(thomson_state, to8_timer_cp2_out))
+ MCFG_MC6846_OUT_CP2_CB(WRITELINE(thomson_state, to8_timer_cp2_out))
MCFG_MC6846_IN_PORT_CB(READ8(thomson_state, to9p_timer_port_in))
/* internal ram */
@@ -2213,7 +2213,7 @@ static MACHINE_CONFIG_DERIVED( mo6, to7 )
MCFG_PIA_READPA_HANDLER(READ8(thomson_state, mo6_sys_porta_in))
MCFG_PIA_READPB_HANDLER(READ8(thomson_state, mo6_sys_portb_in))
MCFG_PIA_WRITEPA_HANDLER(WRITE8(thomson_state, mo6_sys_porta_out))
- MCFG_PIA_WRITEPB_HANDLER(WRITE8(thomson_state, mo6_sys_portb_out))
+ MCFG_PIA_WRITEPB_HANDLER(DEVWRITE8("buzzer", dac_bit_interface, write))
MCFG_PIA_CA2_HANDLER(WRITELINE(thomson_state, mo5_set_cassette_motor))
MCFG_PIA_CB2_HANDLER(WRITELINE(thomson_state, mo6_sys_cb2_out))
MCFG_PIA_IRQB_HANDLER(WRITELINE(thomson_state, thom_irq_1)) /* differs from TO */
@@ -2482,7 +2482,7 @@ static MACHINE_CONFIG_DERIVED( mo5nr, to7 )
MCFG_PIA_READPA_HANDLER(READ8(thomson_state, mo6_sys_porta_in))
MCFG_PIA_READPB_HANDLER(READ8(thomson_state, mo5nr_sys_portb_in))
MCFG_PIA_WRITEPA_HANDLER(WRITE8(thomson_state, mo5nr_sys_porta_out))
- MCFG_PIA_WRITEPB_HANDLER(WRITE8(thomson_state, mo6_sys_portb_out))
+ MCFG_PIA_WRITEPB_HANDLER(DEVWRITE8("buzzer", dac_bit_interface, write))
MCFG_PIA_CA2_HANDLER(WRITELINE(thomson_state, mo5_set_cassette_motor))
MCFG_PIA_CB2_HANDLER(WRITELINE(thomson_state, mo6_sys_cb2_out))
MCFG_PIA_IRQB_HANDLER(WRITELINE(thomson_state, thom_irq_1)) /* differs from TO */
diff --git a/src/mame/drivers/tnzs.cpp b/src/mame/drivers/tnzs.cpp
index 9a033fd1a90..a4929cb53e3 100644
--- a/src/mame/drivers/tnzs.cpp
+++ b/src/mame/drivers/tnzs.cpp
@@ -620,12 +620,12 @@ Driver by Takahiro Nogi (nogi@kt.rim.or.jp) 1999/11/06
***************************************************************************/
-
#include "emu.h"
-#include "cpu/z80/z80.h"
+#include "includes/tnzs.h"
#include "includes/taitoipt.h"
+#include "cpu/z80/z80.h"
#include "sound/2203intf.h"
-#include "includes/tnzs.h"
+#include "sound/volt_reg.h"
#include "sound/ym2151.h"
SAMPLES_START_CB_MEMBER(tnzs_state::kageki_init_samples)
@@ -734,13 +734,6 @@ WRITE8_MEMBER(tnzs_state::kabukiz_sound_bank_w)
m_audiobank->set_entry(data & 0x07);
}
-WRITE8_MEMBER(tnzs_state::kabukiz_sample_w)
-{
- // to avoid the write when the sound chip is initialized
- if (data != 0xff)
- m_dac->write_unsigned8(data);
-}
-
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, tnzs_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM
AM_RANGE(0x8000, 0xbfff) AM_DEVICE("mainbank", address_map_bank_device, amap8)
@@ -1583,12 +1576,12 @@ static MACHINE_CONFIG_START( arknoid2, tnzs_state )
MCFG_PALETTE_INIT_OWNER(tnzs_state,arknoid2)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_SOUND_ADD("ymsnd", YM2203, XTAL_12MHz/4) /* verified on pcb */
MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSWA"))
MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSWB"))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.3)
MACHINE_CONFIG_END
@@ -1629,12 +1622,12 @@ static MACHINE_CONFIG_START( drtoppel, tnzs_state )
MCFG_PALETTE_INIT_OWNER(tnzs_state,arknoid2)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_SOUND_ADD("ymsnd", YM2203, XTAL_12MHz/4)
MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSWA"))
MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSWB"))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.3)
MACHINE_CONFIG_END
@@ -1677,12 +1670,12 @@ static MACHINE_CONFIG_START( tnzs, tnzs_state )
MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_SOUND_ADD("ymsnd", YM2203, XTAL_12MHz/4)
MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSWA"))
MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSWB"))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.3)
MACHINE_CONFIG_END
@@ -1722,12 +1715,12 @@ static MACHINE_CONFIG_START( insectx, tnzs_state )
MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_SOUND_ADD("ymsnd", YM2203, XTAL_12MHz/4) /* verified on pcb */
MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSWA"))
MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSWB"))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.3)
MACHINE_CONFIG_END
@@ -1767,20 +1760,20 @@ static MACHINE_CONFIG_START( kageki, tnzs_state )
MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_SOUND_ADD("ymsnd", YM2203, XTAL_12MHz/4) /* verified on pcb */
MCFG_AY8910_PORT_A_READ_CB(READ8(tnzs_state, kageki_csport_r))
MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(tnzs_state, kageki_csport_w))
- MCFG_SOUND_ROUTE(0, "mono", 0.15)
- MCFG_SOUND_ROUTE(1, "mono", 0.15)
- MCFG_SOUND_ROUTE(2, "mono", 0.15)
- MCFG_SOUND_ROUTE(3, "mono", 0.35)
+ MCFG_SOUND_ROUTE(0, "speaker", 0.15)
+ MCFG_SOUND_ROUTE(1, "speaker", 0.15)
+ MCFG_SOUND_ROUTE(2, "speaker", 0.15)
+ MCFG_SOUND_ROUTE(3, "speaker", 0.35)
MCFG_SOUND_ADD("samples", SAMPLES, 0)
MCFG_SAMPLES_CHANNELS(1)
MCFG_SAMPLES_START_CB(tnzs_state, kageki_init_samples)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
@@ -1824,16 +1817,16 @@ static MACHINE_CONFIG_START( tnzsb, tnzs_state )
MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("ymsnd", YM2203, XTAL_12MHz/4) /* verified on pcb */
MCFG_YM2203_IRQ_HANDLER(WRITELINE(tnzs_state, irqhandler))
- MCFG_SOUND_ROUTE(0, "mono", 1.0)
- MCFG_SOUND_ROUTE(1, "mono", 1.0)
- MCFG_SOUND_ROUTE(2, "mono", 1.0)
- MCFG_SOUND_ROUTE(3, "mono", 2.0)
+ MCFG_SOUND_ROUTE(0, "speaker", 1.0)
+ MCFG_SOUND_ROUTE(1, "speaker", 1.0)
+ MCFG_SOUND_ROUTE(2, "speaker", 1.0)
+ MCFG_SOUND_ROUTE(3, "speaker", 2.0)
MACHINE_CONFIG_END
@@ -1848,10 +1841,11 @@ static MACHINE_CONFIG_DERIVED( kabukiz, tnzsb )
MCFG_SOUND_MODIFY("ymsnd")
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(tnzs_state, kabukiz_sound_bank_w))
- MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(tnzs_state, kabukiz_sample_w))
+ MCFG_AY8910_PORT_B_WRITE_CB(DEVWRITE8("dac", dac_byte_interface, write))
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
@@ -1892,10 +1886,10 @@ static MACHINE_CONFIG_START( jpopnics, tnzs_state )
MCFG_PALETTE_ENDIANNESS(ENDIANNESS_BIG)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_YM2151_ADD("ymsnd", XTAL_12MHz/4) /* Not verified - Main board Crystal is 12MHz */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.3)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/trackfld.cpp b/src/mame/drivers/trackfld.cpp
index 2884a752704..3771ebf3561 100644
--- a/src/mame/drivers/trackfld.cpp
+++ b/src/mame/drivers/trackfld.cpp
@@ -181,17 +181,18 @@ MAIN BOARD:
***************************************************************************/
#include "emu.h"
+#include "includes/trackfld.h"
+#include "includes/konamipt.h"
+#include "audio/trackfld.h"
+#include "audio/hyprolyb.h"
#include "cpu/z80/z80.h"
#include "cpu/m6800/m6800.h"
-#include "machine/konami1.h"
#include "cpu/m6809/m6809.h"
-#include "sound/dac.h"
-#include "audio/trackfld.h"
-#include "audio/hyprolyb.h"
-#include "includes/trackfld.h"
-#include "includes/konamipt.h"
+#include "machine/konami1.h"
#include "machine/nvram.h"
#include "machine/watchdog.h"
+#include "sound/dac.h"
+#include "sound/volt_reg.h"
#define MASTER_CLOCK XTAL_18_432MHz
#define SOUND_CLOCK XTAL_14_31818MHz
@@ -406,7 +407,7 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, trackfld_state )
AM_RANGE(0x8000, 0x8000) AM_MIRROR(0x1fff) AM_DEVREAD("trackfld_audio", trackfld_audio_device, trackfld_sh_timer_r)
AM_RANGE(0xa000, 0xa000) AM_MIRROR(0x1fff) AM_WRITE(konami_SN76496_latch_w)
AM_RANGE(0xc000, 0xc000) AM_MIRROR(0x1fff) AM_READ(trackfld_SN76496_r) AM_WRITE(konami_SN76496_w)
- AM_RANGE(0xe000, 0xe000) AM_MIRROR(0x1ff8) AM_DEVWRITE("dac", dac_device, write_unsigned8)
+ AM_RANGE(0xe000, 0xe000) AM_MIRROR(0x1ff8) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(0xe001, 0xe001) AM_MIRROR(0x1ff8) AM_NOP /* watch dog ?; reaktor reads here */
AM_RANGE(0xe002, 0xe002) AM_MIRROR(0x1ff8) AM_DEVREAD("trackfld_audio", trackfld_audio_device, trackfld_speech_r)
AM_RANGE(0xe003, 0xe003) AM_MIRROR(0x1c78) AM_SELECT(0x0380) AM_DEVWRITE("trackfld_audio", trackfld_audio_device, trackfld_sound_w)
@@ -420,7 +421,7 @@ static ADDRESS_MAP_START( hyprolyb_sound_map, AS_PROGRAM, 8, trackfld_state )
AM_RANGE(0x8000, 0x8000) AM_MIRROR(0x1fff) AM_DEVREAD("trackfld_audio", trackfld_audio_device, trackfld_sh_timer_r)
AM_RANGE(0xa000, 0xa000) AM_MIRROR(0x1fff) AM_WRITE(konami_SN76496_latch_w)
AM_RANGE(0xc000, 0xc000) AM_MIRROR(0x1fff) AM_READ(trackfld_SN76496_r) AM_WRITE(konami_SN76496_w)
- AM_RANGE(0xe000, 0xe000) AM_MIRROR(0x1ff8) AM_DEVWRITE("dac", dac_device, write_unsigned8)
+ AM_RANGE(0xe000, 0xe000) AM_MIRROR(0x1ff8) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(0xe001, 0xe001) AM_MIRROR(0x1ff8) AM_NOP /* watch dog ?; reaktor reads here */
AM_RANGE(0xe002, 0xe002) AM_MIRROR(0x1ff8) AM_DEVREAD("hyprolyb_adpcm", hyprolyb_adpcm_device, busy_r)
AM_RANGE(0xe003, 0xe003) AM_MIRROR(0x1ff8) AM_WRITENOP
@@ -927,21 +928,22 @@ static MACHINE_CONFIG_START( trackfld, trackfld_state )
MCFG_VIDEO_START_OVERRIDE(trackfld_state,trackfld)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("trackfld_audio", TRACKFLD_AUDIO, 0)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.4) // ls374.8e + r34-r47(20k) + r35-r53(10k) + r54(20k) + upc324.8f
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MCFG_SOUND_ADD("snsnd", SN76496, SOUND_CLOCK/8)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MCFG_SOUND_ADD("vlm", VLM5030, VLM_CLOCK)
MCFG_DEVICE_ADDRESS_MAP(AS_0, vlm_map)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
@@ -985,21 +987,22 @@ static MACHINE_CONFIG_START( yieartf, trackfld_state )
MCFG_VIDEO_START_OVERRIDE(trackfld_state,trackfld)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("trackfld_audio", TRACKFLD_AUDIO, 0)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.4) // ls374.8e + r34-r47(20k) + r35-r53(10k) + r54(20k) + upc324.8f
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MCFG_SOUND_ADD("snsnd", SN76496, MASTER_CLOCK/6/2)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MCFG_SOUND_ADD("vlm", VLM5030, VLM_CLOCK)
MCFG_DEVICE_ADDRESS_MAP(AS_0, vlm_map)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
/* same as the original, but uses ADPCM instead of VLM5030 */
diff --git a/src/mame/drivers/truco.cpp b/src/mame/drivers/truco.cpp
index bf8f120f853..ad9fb1fd633 100644
--- a/src/mame/drivers/truco.cpp
+++ b/src/mame/drivers/truco.cpp
@@ -201,17 +201,16 @@
*******************************************************************************************************/
-
#define MASTER_CLOCK XTAL_12MHz /* confirmed */
#define CPU_CLOCK (MASTER_CLOCK/16) /* guess */
#define CRTC_CLOCK (MASTER_CLOCK/8) /* guess */
#include "emu.h"
+#include "includes/truco.h"
#include "cpu/m6809/m6809.h"
-#include "video/mc6845.h"
#include "machine/6821pia.h"
-#include "includes/truco.h"
-
+#include "sound/volt_reg.h"
+#include "video/mc6845.h"
/*******************************************
* Read/Write Handlers *
@@ -237,11 +236,9 @@ WRITE_LINE_MEMBER(truco_state::pia_ca2_w)
WRITE8_MEMBER(truco_state::portb_w)
{
- if ((data & 0x80) | (data == 0))
- {
- m_dac->write_unsigned8(data & 0x80); /* Isolated the bit for Delta-Sigma DAC */
- }
- else
+ m_dac->write(BIT(data, 7)); /* Isolated the bit for Delta-Sigma DAC */
+
+ if (data & 0x7f)
logerror("Port B writes: %2x\n", data);
}
@@ -451,10 +448,10 @@ static MACHINE_CONFIG_START( truco, truco_state )
MCFG_MC6845_CHAR_WIDTH(4)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
-
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.4)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/trucocl.cpp b/src/mame/drivers/trucocl.cpp
index 75ed2f7bdca..cfc4c675b8b 100644
--- a/src/mame/drivers/trucocl.cpp
+++ b/src/mame/drivers/trucocl.cpp
@@ -35,10 +35,10 @@ Daughterboard: Custom made, plugged in the 2 roms and Z80 mainboard sockets.
***************************************************************************/
#include "emu.h"
+#include "includes/trucocl.h"
#include "cpu/z80/z80.h"
#include "machine/watchdog.h"
-#include "sound/dac.h"
-#include "includes/trucocl.h"
+#include "sound/volt_reg.h"
WRITE8_MEMBER(trucocl_state::irq_enable_w)
{
@@ -83,7 +83,7 @@ WRITE8_MEMBER(trucocl_state::audio_dac_w)
dac_address += 0x10000;
- m_dac->write_unsigned8( rom[dac_address+m_cur_dac_address_index] );
+ m_dac->write(rom[dac_address+m_cur_dac_address_index]);
timer_set( attotime::from_hz( 16000 ), TIMER_DAC_IRQ);
}
@@ -160,10 +160,11 @@ static MACHINE_CONFIG_START( trucocl, trucocl_state )
MCFG_PALETTE_INIT_OWNER(trucocl_state, trucocl)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
/***************************************************************************
diff --git a/src/mame/drivers/tsamurai.cpp b/src/mame/drivers/tsamurai.cpp
index ffdfa325c3e..29d88419a53 100644
--- a/src/mame/drivers/tsamurai.cpp
+++ b/src/mame/drivers/tsamurai.cpp
@@ -39,10 +39,11 @@ the "America" release.
****************************************************************************/
#include "emu.h"
+#include "includes/tsamurai.h"
#include "cpu/z80/z80.h"
#include "sound/ay8910.h"
#include "sound/dac.h"
-#include "includes/tsamurai.h"
+#include "sound/volt_reg.h"
void tsamurai_state::machine_start()
@@ -238,7 +239,7 @@ static ADDRESS_MAP_START( sound1_map, AS_PROGRAM, 8, tsamurai_state )
AM_RANGE(0x0000, 0x3fff) AM_ROM
AM_RANGE(0x6000, 0x6000) AM_READ(sound_command1_r)
AM_RANGE(0x6001, 0x6001) AM_WRITENOP /* ? - probably clear IRQ */
- AM_RANGE(0x6002, 0x6002) AM_DEVWRITE("dac1", dac_device, write_unsigned8)
+ AM_RANGE(0x6002, 0x6002) AM_DEVWRITE("dac1", dac_byte_interface, write)
AM_RANGE(0x7f00, 0x7fff) AM_RAM
ADDRESS_MAP_END
@@ -248,7 +249,7 @@ static ADDRESS_MAP_START( sound2_map, AS_PROGRAM, 8, tsamurai_state )
AM_RANGE(0x0000, 0x3fff) AM_ROM
AM_RANGE(0x6000, 0x6000) AM_READ(sound_command2_r)
AM_RANGE(0x6001, 0x6001) AM_WRITENOP /* ? - probably clear IRQ */
- AM_RANGE(0x6002, 0x6002) AM_DEVWRITE("dac2", dac_device, write_unsigned8)
+ AM_RANGE(0x6002, 0x6002) AM_DEVWRITE("dac2", dac_byte_interface, write)
AM_RANGE(0x7f00, 0x7fff) AM_RAM
ADDRESS_MAP_END
@@ -258,7 +259,7 @@ static ADDRESS_MAP_START( sound1_m660_map, AS_PROGRAM, 8, tsamurai_state )
AM_RANGE(0x0000, 0x3fff) AM_ROM
AM_RANGE(0xc000, 0xc000) AM_READ(sound_command1_r)
AM_RANGE(0xc001, 0xc001) AM_WRITENOP /* ? - probably clear IRQ */
- AM_RANGE(0xc002, 0xc002) AM_DEVWRITE("dac1", dac_device, write_unsigned8)
+ AM_RANGE(0xc002, 0xc002) AM_DEVWRITE("dac1", dac_byte_interface, write)
AM_RANGE(0x8000, 0x87ff) AM_RAM
ADDRESS_MAP_END
@@ -268,7 +269,7 @@ static ADDRESS_MAP_START( sound2_m660_map, AS_PROGRAM, 8, tsamurai_state )
AM_RANGE(0x0000, 0x3fff) AM_ROM
AM_RANGE(0xc000, 0xc000) AM_READ(sound_command2_r)
AM_RANGE(0xc001, 0xc001) AM_WRITENOP /* ? - probably clear IRQ */
- AM_RANGE(0xc002, 0xc002) AM_DEVWRITE("dac2", dac_device, write_unsigned8)
+ AM_RANGE(0xc002, 0xc002) AM_DEVWRITE("dac2", dac_byte_interface, write)
AM_RANGE(0x8000, 0x87ff) AM_RAM
ADDRESS_MAP_END
@@ -360,7 +361,7 @@ static ADDRESS_MAP_START( sound_vsgongf_map, AS_PROGRAM, 8, tsamurai_state )
AM_RANGE(0x0000, 0x3fff) AM_ROM
AM_RANGE(0x6000, 0x63ff) AM_RAM /* work RAM */
AM_RANGE(0x8000, 0x8000) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_WRITE(vsgongf_sound_nmi_enable_w) /* NMI enable */
- AM_RANGE(0xa000, 0xa000) AM_DEVWRITE("dac", dac_device, write_unsigned8)
+ AM_RANGE(0xa000, 0xa000) AM_DEVWRITE("dac", dac_byte_interface, write)
ADDRESS_MAP_END
/*******************************************************************************/
@@ -732,16 +733,16 @@ static MACHINE_CONFIG_START( tsamurai, tsamurai_state )
MCFG_VIDEO_START_OVERRIDE(tsamurai_state,tsamurai)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_SOUND_ADD("aysnd", AY8910, XTAL_24MHz/8)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.1)
- MCFG_DAC_ADD("dac1")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
-
- MCFG_DAC_ADD("dac2")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
+ MCFG_SOUND_ADD("dac1", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.1) // unknown DAC
+ MCFG_SOUND_ADD("dac2", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.1) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac1", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac1", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac2", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac2", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
@@ -773,15 +774,16 @@ static MACHINE_CONFIG_START( vsgongf, tsamurai_state )
MCFG_VIDEO_START_OVERRIDE(tsamurai_state,vsgongf)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("aysnd", AY8910, XTAL_24MHz/8)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.1)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.1) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
@@ -820,16 +822,16 @@ static MACHINE_CONFIG_START( m660, tsamurai_state )
MCFG_VIDEO_START_OVERRIDE(tsamurai_state,m660)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_SOUND_ADD("aysnd", AY8910, XTAL_24MHz/8)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10)
-
- MCFG_DAC_ADD("dac1")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.1)
- MCFG_DAC_ADD("dac2")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
+ MCFG_SOUND_ADD("dac1", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.1) // unknown DAC
+ MCFG_SOUND_ADD("dac2", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.1) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac1", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac1", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac2", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac2", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
/*******************************************************************************/
diff --git a/src/mame/drivers/tsispch.cpp b/src/mame/drivers/tsispch.cpp
index 9964141f3cf..1ba51dcba2e 100644
--- a/src/mame/drivers/tsispch.cpp
+++ b/src/mame/drivers/tsispch.cpp
@@ -112,11 +112,13 @@
/* Core includes */
#include "emu.h"
#include "includes/tsispch.h"
-#include "cpu/upd7725/upd7725.h"
#include "cpu/i86/i86.h"
+#include "cpu/upd7725/upd7725.h"
#include "machine/i8251.h"
#include "machine/pic8259.h"
#include "machine/terminal.h"
+#include "sound/dac.h"
+#include "sound/volt_reg.h"
// defines
#define DEBUG_PARAM 1
@@ -402,9 +404,10 @@ static MACHINE_CONFIG_START( prose2k, tsispch_state )
MCFG_I8251_TXEMPTY_HANDLER(WRITELINE(tsispch_state, i8251_txempty_int))
/* sound hardware */
- //MCFG_SPEAKER_STANDARD_MONO("mono")
- //MCFG_SOUND_ADD("dac", DAC, 0) /* TODO: correctly figure out how the DAC works; apparently it is connected to the serial output of the upd7720, which will be "fun" to connect up */
- //MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_12BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0) // unknown DAC (TODO: correctly figure out how the DAC works; apparently it is connected to the serial output of the upd7720, which will be "fun" to connect up)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MCFG_DEVICE_ADD(TERMINAL_TAG, GENERIC_TERMINAL, 0)
MCFG_GENERIC_TERMINAL_KEYBOARD_CB(WRITE8(tsispch_state, i8251_rxd))
diff --git a/src/mame/drivers/ut88.cpp b/src/mame/drivers/ut88.cpp
index 8849215091a..4c5b49c7754 100644
--- a/src/mame/drivers/ut88.cpp
+++ b/src/mame/drivers/ut88.cpp
@@ -26,6 +26,7 @@ Paste facility was tested but doesn't work, so all code remnants removed.
#include "formats/rk_cas.h"
#include "softlist.h"
#include "ut88mini.lh"
+#include "sound/volt_reg.h"
static GFXDECODE_START( ut88 )
GFXDECODE_ENTRY( "chargen", 0x0000, ut88_charlayout, 0, 1 )
@@ -198,11 +199,13 @@ static MACHINE_CONFIG_START( ut88, ut88_state )
MCFG_GFXDECODE_ADD("gfxdecode", "palette", ut88 )
/* audio hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("dac", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT)
+
MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
/* Devices */
MCFG_DEVICE_ADD("ppi8255", I8255A, 0)
@@ -230,9 +233,9 @@ static MACHINE_CONFIG_START( ut88mini, ut88_state )
MCFG_DEFAULT_LAYOUT(layout_ut88mini)
/* Cassette */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
MCFG_CASSETTE_ADD( "cassette" )
MCFG_CASSETTE_FORMATS(rku_cassette_formats)
diff --git a/src/mame/drivers/vcombat.cpp b/src/mame/drivers/vcombat.cpp
index ad72f7770b8..aad397a13f6 100644
--- a/src/mame/drivers/vcombat.cpp
+++ b/src/mame/drivers/vcombat.cpp
@@ -83,13 +83,14 @@ TODO : This is a partially working driver. Most of the memory maps for
*/
#include "emu.h"
-#include "rendlay.h"
#include "cpu/m68000/m68000.h"
#include "cpu/i860/i860.h"
+#include "machine/nvram.h"
+#include "sound/dac.h"
+#include "sound/volt_reg.h"
#include "video/tlc34076.h"
#include "video/mc6845.h"
-#include "sound/dac.h"
-#include "machine/nvram.h"
+#include "rendlay.h"
class vcombat_state : public driver_device
@@ -133,7 +134,7 @@ public:
required_device<cpu_device> m_soundcpu;
required_device<i860_cpu_device> m_vid_0;
optional_device<i860_cpu_device> m_vid_1;
- required_device<dac_device> m_dac;
+ required_device<dac_word_interface> m_dac;
};
static UINT32 update_screen(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, int index)
@@ -341,8 +342,9 @@ WRITE16_MEMBER(vcombat_state::crtc_w)
WRITE16_MEMBER(vcombat_state::vcombat_dac_w)
{
- INT16 newval = ((INT16)data - 0x6000) << 2;
- m_dac->write_signed16(newval + 0x8000);
+ m_dac->write(data >> 5);
+ if (data & 0x801f)
+ fprintf(stderr, "dac overflow %04x\n", data & 0x801f);
}
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, vcombat_state )
@@ -580,10 +582,10 @@ static MACHINE_CONFIG_START( vcombat, vcombat_state )
MCFG_SCREEN_RAW_PARAMS(XTAL_12MHz / 2, 400, 0, 256, 291, 0, 208)
MCFG_SCREEN_UPDATE_DRIVER(vcombat_state, screen_update_vcombat_aux)
- MCFG_SPEAKER_STANDARD_MONO("mono")
-
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_10BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
@@ -614,10 +616,10 @@ static MACHINE_CONFIG_START( shadfgtr, vcombat_state )
MCFG_SCREEN_RAW_PARAMS(XTAL_20MHz / 4, 320, 0, 256, 277, 0, 224)
MCFG_SCREEN_UPDATE_DRIVER(vcombat_state, screen_update_vcombat_main)
- MCFG_SPEAKER_STANDARD_MONO("mono")
-
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_10BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/vectrex.cpp b/src/mame/drivers/vectrex.cpp
index 2cbc763c581..402f30b27cb 100644
--- a/src/mame/drivers/vectrex.cpp
+++ b/src/mame/drivers/vectrex.cpp
@@ -11,13 +11,13 @@ Bruce Tomlin (hardware info)
*****************************************************************/
#include "emu.h"
+#include "includes/vectrex.h"
#include "cpu/m6809/m6809.h"
-#include "video/vector.h"
#include "machine/6522via.h"
-#include "includes/vectrex.h"
-#include "sound/ay8910.h"
-#include "sound/dac.h"
#include "machine/nvram.h"
+#include "sound/ay8910.h"
+#include "sound/volt_reg.h"
+#include "video/vector.h"
#include "softlist.h"
static ADDRESS_MAP_START(vectrex_map, AS_PROGRAM, 8, vectrex_state )
@@ -105,13 +105,15 @@ static MACHINE_CONFIG_START( vectrex, vectrex_state )
MCFG_SCREEN_UPDATE_DRIVER(vectrex_state, screen_update_vectrex)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", MC1408, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) // mc1408.ic301 (also used for vector generation)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
+
MCFG_SOUND_ADD("ay8912", AY8912, 1500000)
MCFG_AY8910_PORT_A_READ_CB(IOPORT("BUTTONS"))
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(vectrex_state, vectrex_psg_port_w))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.2)
/* via */
MCFG_DEVICE_ADD("via6522_0", VIA6522, 0)
diff --git a/src/mame/drivers/vg5k.cpp b/src/mame/drivers/vg5k.cpp
index 6beab3219bb..2360fe3fabd 100644
--- a/src/mame/drivers/vg5k.cpp
+++ b/src/mame/drivers/vg5k.cpp
@@ -50,13 +50,14 @@
#include "emu.h"
#include "cpu/z80/z80.h"
-#include "machine/ram.h"
+#include "formats/vg5k_cas.h"
+#include "imagedev/cassette.h"
#include "imagedev/printer.h"
-#include "video/ef9345.h"
+#include "machine/ram.h"
#include "sound/dac.h"
-#include "imagedev/cassette.h"
#include "sound/wave.h"
-#include "formats/vg5k_cas.h"
+#include "sound/volt_reg.h"
+#include "video/ef9345.h"
#include "softlist.h"
class vg5k_state : public driver_device
@@ -74,7 +75,7 @@ public:
required_device<cpu_device> m_maincpu;
required_device<ef9345_device> m_ef9345;
- required_device<dac_device> m_dac;
+ required_device<dac_bit_interface> m_dac;
required_device<printer_image_device> m_printer;
required_device<cassette_image_device> m_cassette;
required_device<ram_device> m_ram;
@@ -138,7 +139,7 @@ READ8_MEMBER ( vg5k_state::cassette_r )
WRITE8_MEMBER ( vg5k_state::cassette_w )
{
- m_dac->write_unsigned8(data <<2);
+ m_dac->write(BIT(data, 3));
if (data == 0x03)
m_cassette->output(+1);
@@ -377,13 +378,14 @@ static MACHINE_CONFIG_START( vg5k, vg5k_state )
MCFG_PALETTE_ADD("palette", 8)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("dac", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.125)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT)
/* cassette */
MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette")
- MCFG_SOUND_ROUTE(0, "mono", 0.25)
+ MCFG_SOUND_ROUTE(0, "speaker", 0.25)
MCFG_CASSETTE_ADD( "cassette" )
MCFG_CASSETTE_FORMATS(vg5k_cassette_formats)
diff --git a/src/mame/drivers/vic10.cpp b/src/mame/drivers/vic10.cpp
index 42ceda580d1..1cb9152842c 100644
--- a/src/mame/drivers/vic10.cpp
+++ b/src/mame/drivers/vic10.cpp
@@ -17,7 +17,6 @@
#include "cpu/m6502/m6510.h"
#include "machine/mos6526.h"
#include "machine/ram.h"
-#include "sound/dac.h"
#include "sound/mos6581.h"
#include "video/mos6566.h"
diff --git a/src/mame/drivers/vic20.cpp b/src/mame/drivers/vic20.cpp
index 01025a50ae9..b19c2614325 100644
--- a/src/mame/drivers/vic20.cpp
+++ b/src/mame/drivers/vic20.cpp
@@ -20,7 +20,6 @@
#include "machine/6522via.h"
#include "machine/cbm_snqk.h"
#include "machine/ram.h"
-#include "sound/dac.h"
#include "sound/mos6560.h"
#define M6502_TAG "ue10"
diff --git a/src/mame/drivers/vidbrain.cpp b/src/mame/drivers/vidbrain.cpp
index 3152f953e56..15be596cddc 100644
--- a/src/mame/drivers/vidbrain.cpp
+++ b/src/mame/drivers/vidbrain.cpp
@@ -36,6 +36,8 @@
*/
#include "includes/vidbrain.h"
+#include "machine/rescap.h"
+#include "sound/volt_reg.h"
#include "softlist.h"
#include "vidbrain.lh"
@@ -142,19 +144,7 @@ WRITE8_MEMBER( vidbrain_state::sound_w )
if (!m_sound_clk && sound_clk)
{
- //m_discrete->write(space, NODE_01, m_keylatch & 0x03);
-
- UINT8 dac_data = 0;
-
- switch (m_keylatch & 0x03)
- {
- case 0: dac_data = 0x00; break;
- case 1: dac_data = 0x55; break;
- case 2: dac_data = 0xaa; break;
- case 3: dac_data = 0xff; break;
- }
-
- m_dac->write_unsigned8(dac_data);
+ m_dac->write(m_keylatch & 3);
}
m_sound_clk = sound_clk;
@@ -367,29 +357,6 @@ INPUT_PORTS_END
//**************************************************************************
-// SOUND
-//**************************************************************************
-
-//-------------------------------------------------
-// DISCRETE_SOUND( vidbrain )
-//-------------------------------------------------
-
-static const discrete_dac_r1_ladder vidbrain_dac =
-{
- 2,
- { RES_K(120), RES_K(120) }, // R=56K, 2R=120K
- 0, 0, RES_K(120), 0
-};
-
-static DISCRETE_SOUND_START( vidbrain )
- DISCRETE_INPUT_DATA(NODE_01)
- DISCRETE_DAC_R1(NODE_02, NODE_01, DEFAULT_TTL_V_LOGIC_1, &vidbrain_dac)
- DISCRETE_OUTPUT(NODE_02, 5000)
-DISCRETE_SOUND_END
-
-
-
-//**************************************************************************
// DEVICE CONFIGURATION
//**************************************************************************
@@ -545,13 +512,10 @@ static MACHINE_CONFIG_START( vidbrain, vidbrain_state )
MCFG_UV201_DB_CALLBACK(READ8(vidbrain_state, memory_read_byte))
// sound hardware
- MCFG_SPEAKER_STANDARD_MONO("mono")
-
- MCFG_SOUND_ADD(DISCRETE_TAG, DISCRETE, 0)
- MCFG_DISCRETE_INTF(vidbrain)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
- MCFG_SOUND_ADD(DAC_TAG, DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_2BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.167) // 74ls74.u16 + 120k + 56k
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
// devices
MCFG_DEVICE_ADD(F3853_TAG, F3853, XTAL_4MHz/2)
diff --git a/src/mame/drivers/videopkr.cpp b/src/mame/drivers/videopkr.cpp
index 727c3968138..969634e91d7 100644
--- a/src/mame/drivers/videopkr.cpp
+++ b/src/mame/drivers/videopkr.cpp
@@ -285,6 +285,7 @@
#include "machine/nvram.h"
#include "sound/ay8910.h"
#include "sound/dac.h"
+#include "sound/volt_reg.h"
#include "videopkr.lh"
#include "blckjack.lh"
#include "videocba.lh"
@@ -369,7 +370,7 @@ public:
void count_7dig(unsigned long data, UINT8 index);
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_soundcpu;
- required_device<dac_device> m_dac;
+ required_device<dac_byte_interface> m_dac;
required_device<gfxdecode_device> m_gfxdecode;
};
@@ -894,7 +895,7 @@ READ8_MEMBER(videopkr_state::baby_sound_p2_r)
WRITE8_MEMBER(videopkr_state::baby_sound_p2_w)
{
m_sbp2 = data;
- m_dac->write_unsigned8(data);
+ m_dac->write(data);
}
READ8_MEMBER(videopkr_state::baby_sound_p3_r)
@@ -970,7 +971,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( i8039_sound_port, AS_IO, 8, videopkr_state )
AM_RANGE(0x00 , 0xff ) AM_READWRITE(sound_io_r, sound_io_w)
- AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_DEVWRITE("dac", dac_device, write_unsigned8)
+ AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_DEVWRITE("dac", dac_byte_interface, write)
AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_READWRITE(sound_p2_r, sound_p2_w)
ADDRESS_MAP_END
@@ -1255,9 +1256,10 @@ static MACHINE_CONFIG_START( videopkr, videopkr_state )
MCFG_PALETTE_INIT_OWNER(videopkr_state, videopkr)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.55)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.275) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
@@ -1309,7 +1311,7 @@ static MACHINE_CONFIG_DERIVED( babypkr, videopkr )
MCFG_VIDEO_START_OVERRIDE(videopkr_state,vidadcba)
MCFG_SOUND_ADD("aysnd", AY8910, CPU_CLOCK / 6) /* no ports used */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.3)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( fortune1, videopkr )
diff --git a/src/mame/drivers/vigilant.cpp b/src/mame/drivers/vigilant.cpp
index af5b0dae08f..2b538256a0b 100644
--- a/src/mame/drivers/vigilant.cpp
+++ b/src/mame/drivers/vigilant.cpp
@@ -22,12 +22,12 @@ Bottom board - M75-B-A (all versions regardless of mask ROM/EPROM)
***************************************************************************/
#include "emu.h"
+#include "includes/vigilant.h"
+#include "includes/iremipt.h"
#include "cpu/z80/z80.h"
-#include "sound/dac.h"
#include "sound/2203intf.h"
+#include "sound/volt_reg.h"
#include "sound/ym2151.h"
-#include "includes/vigilant.h"
-#include "includes/iremipt.h"
void vigilant_state::machine_start()
{
@@ -505,9 +505,9 @@ static MACHINE_CONFIG_START( vigilant, vigilant_state )
MCFG_SOUND_ROUTE(0, "lspeaker", 0.55)
MCFG_SOUND_ROUTE(1, "rspeaker", 0.55)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( buccanrs, vigilant_state )
@@ -564,9 +564,9 @@ static MACHINE_CONFIG_START( buccanrs, vigilant_state )
MCFG_SOUND_ROUTE(3, "lspeaker", 0.50)
MCFG_SOUND_ROUTE(3, "rspeaker", 0.50)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.35)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.35)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.35) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.35) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( kikcubic, vigilant_state )
@@ -607,9 +607,9 @@ static MACHINE_CONFIG_START( kikcubic, vigilant_state )
MCFG_SOUND_ROUTE(0, "lspeaker", 0.55)
MCFG_SOUND_ROUTE(1, "rspeaker", 0.55)
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/vis.cpp b/src/mame/drivers/vis.cpp
index 706e39ae71b..1f5c3c77f7b 100644
--- a/src/mame/drivers/vis.cpp
+++ b/src/mame/drivers/vis.cpp
@@ -4,8 +4,9 @@
#include "emu.h"
#include "cpu/i86/i286.h"
#include "machine/at.h"
-#include "sound/dac.h"
#include "sound/262intf.h"
+#include "sound/dac.h"
+#include "sound/volt_reg.h"
#include "bus/isa/isa_cards.h"
class vis_audio_device : public device_t,
@@ -22,8 +23,8 @@ protected:
virtual void dack16_w(int line, UINT16 data) override { if(m_samples < 2) m_sample[m_samples++] = data; else m_isa->drq7_w(CLEAR_LINE); }
virtual machine_config_constructor device_mconfig_additions() const override;
private:
- required_device<dac_device> m_dacr;
- required_device<dac_device> m_dacl;
+ required_device<dac_word_interface> m_rdac;
+ required_device<dac_word_interface> m_ldac;
UINT16 m_count;
UINT16 m_sample[2];
UINT8 m_index[2]; // unknown indexed registers, volume?
@@ -40,8 +41,8 @@ const device_type VIS_AUDIO = &device_creator<vis_audio_device>;
vis_audio_device::vis_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, VIS_AUDIO, "vis_pcm", tag, owner, clock, "vis_pcm", __FILE__),
device_isa16_card_interface(mconfig, *this),
- m_dacr(*this, "dacr"),
- m_dacl(*this, "dacl")
+ m_rdac(*this, "rdac"),
+ m_ldac(*this, "ldac")
{
}
@@ -72,24 +73,24 @@ void vis_audio_device::device_timer(emu_timer &timer, device_timer_id id, int pa
case 0x80: // 8bit mono
{
UINT8 sample = m_sample[m_sample_byte >> 1] >> ((m_sample_byte & 1) * 8);
- m_dacl->write_signed8(sample);
- m_dacr->write_signed8(sample);
+ m_ldac->write(sample << 8);
+ m_rdac->write(sample << 8);
m_sample_byte++;
break;
}
case 0x00: // 8bit stereo
- m_dacl->write_signed8(m_sample[m_sample_byte >> 1] & 0xff);
- m_dacr->write_signed8(m_sample[m_sample_byte >> 1] >> 8);
+ m_ldac->write(m_sample[m_sample_byte >> 1] << 8);
+ m_rdac->write(m_sample[m_sample_byte >> 1] & 0xff00);
m_sample_byte += 2;
break;
case 0x88: // 16bit mono
- m_dacl->write((INT16)m_sample[m_sample_byte >> 1]);
- m_dacr->write((INT16)m_sample[m_sample_byte >> 1]);
+ m_ldac->write(m_sample[m_sample_byte >> 1] ^ 0x8000);
+ m_rdac->write(m_sample[m_sample_byte >> 1] ^ 0x8000);
m_sample_byte += 2;
break;
case 0x08: // 16bit stereo
- m_dacl->write((INT16)m_sample[0]);
- m_dacr->write((INT16)m_sample[1]);
+ m_ldac->write(m_sample[0] ^ 0x8000);
+ m_rdac->write(m_sample[1] ^ 0x8000);
m_sample_byte += 4;
break;
}
@@ -99,18 +100,16 @@ void vis_audio_device::device_timer(emu_timer &timer, device_timer_id id, int pa
m_sample_byte = 0;
m_samples = 0;
if(m_count)
- {
- m_count--;
m_isa->drq7_w(ASSERT_LINE);
- }
else
{
- m_dacl->write(0);
- m_dacr->write(0);
+ m_ldac->write(0x8000);
+ m_rdac->write(0x8000);
m_stat = 4;
m_pcm->adjust(attotime::never);
m_isa->irq7_w(ASSERT_LINE);
}
+ m_count--;
}
}
@@ -121,10 +120,11 @@ static MACHINE_CONFIG_FRAGMENT( vis_pcm_config )
MCFG_SOUND_ROUTE(1, "rspeaker", 1.00)
MCFG_SOUND_ROUTE(2, "lspeaker", 1.00)
MCFG_SOUND_ROUTE(3, "rspeaker", 1.00)
- MCFG_SOUND_ADD("dacl", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.00)
- MCFG_SOUND_ADD("dacr", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.00)
+ MCFG_SOUND_ADD("ldac", DAC_16BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) // unknown DAC
+ MCFG_SOUND_ADD("rdac", DAC_16BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "ldac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "ldac", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "rdac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "rdac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
machine_config_constructor vis_audio_device::device_mconfig_additions() const
diff --git a/src/mame/drivers/wheelfir.cpp b/src/mame/drivers/wheelfir.cpp
index e2f2c10c88c..3f8dcc2c122 100644
--- a/src/mame/drivers/wheelfir.cpp
+++ b/src/mame/drivers/wheelfir.cpp
@@ -10,15 +10,13 @@ driver by
TODO:
-- sound comms
-- eeprom
+- analogue accelerator is really slow
- various gfx size/pos glitches (gaps, extra rows of pixels here and there)
- real gfx zoom, based on the zoom params, not lookup table
- apply double buffering (sometimes gfx is displayed at y+256 every other frame (extra bits are currently masked out))
- fix road/sky (extra bits in the scroll reg. are there two bitmap buffers? )
- bitmap layer clearing
- fix wrong coords of sprites rendered into the bitmap layer (intro car)
-- is toggle_bit really a vblank bit ? or somethign else (blitter status ?)
- implement(and find) layer enable/disable bits
@@ -208,11 +206,12 @@ suspicious code:
*/
-
#include "emu.h"
-#include "machine/eepromser.h"
#include "cpu/m68000/m68000.h"
+#include "machine/eepromser.h"
+#include "machine/gen_latch.h"
#include "sound/dac.h"
+#include "sound/volt_reg.h"
static const int ZOOM_TABLE_SIZE=1<<14;
static const int NUM_SCANLINES=256-8;
@@ -234,11 +233,13 @@ public:
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_subcpu(*this, "subcpu"),
+ m_eeprom(*this, "eeprom"),
m_screen(*this, "screen"),
m_palette(*this, "palette") { }
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_subcpu;
+ required_device<eeprom_serial_93cxx_device> m_eeprom;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
@@ -248,18 +249,14 @@ public:
std::unique_ptr<UINT8[]> m_palette_ptr;
INT32 m_palpos;
- INT32 m_current_scanline;
scroll_info *m_scanlines;
- INT32 m_soundlatch;
-
INT32 m_direct_write_x0;
INT32 m_direct_write_x1;
INT32 m_direct_write_y0;
INT32 m_direct_write_y1;
INT32 m_direct_write_idx;
- INT32 m_toggle_bit;
INT16 m_scanline_cnt;
@@ -277,18 +274,16 @@ public:
}
return 0;
}
- DECLARE_READ16_MEMBER(wheelfir_status_r);
DECLARE_WRITE16_MEMBER(wheelfir_scanline_cnt_w);
DECLARE_WRITE16_MEMBER(wheelfir_blit_w);
DECLARE_WRITE16_MEMBER(pal_reset_pos_w);
DECLARE_WRITE16_MEMBER(pal_data_w);
DECLARE_WRITE16_MEMBER(wheelfir_7c0000_w);
+ DECLARE_READ16_MEMBER(wheelfir_7c0000_r);
DECLARE_WRITE16_MEMBER(wheelfir_snd_w);
DECLARE_READ16_MEMBER(wheelfir_snd_r);
DECLARE_WRITE16_MEMBER(coin_cnt_w);
- DECLARE_DRIVER_INIT(wheelfir);
virtual void machine_start() override;
- virtual void machine_reset() override;
virtual void video_start() override;
UINT32 screen_update_wheelfir(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void screen_eof_wheelfir(screen_device &screen, bool state);
@@ -296,20 +291,6 @@ public:
};
-READ16_MEMBER(wheelfir_state::wheelfir_status_r)
-{
-/*
- fedcba9876543210
- x--------------- vblank ?
- --x------------- ? must be 1
- --------------x- ? eeprom
- ---------------x ? eeprom
-
-*/
-
- return m_toggle_bit| (machine().rand()&0x2000);
-}
-
WRITE16_MEMBER(wheelfir_state::wheelfir_scanline_cnt_w)
{
COMBINE_DATA(&m_scanline_cnt);
@@ -350,40 +331,6 @@ WRITE16_MEMBER(wheelfir_state::wheelfir_blit_w)
}
- int yscroll=-1;
- int xscroll=-1;
-
- if(offset==0x0a && ACCESSING_BITS_0_7)
- {
- xscroll = (m_blitter_data[0xa]&0x00ff) | (m_blitter_data[0x8]&0x0040) << 2;
- }
-
- if(offset==0x0b && ACCESSING_BITS_0_7)
- {
- yscroll = (m_blitter_data[0xb]&0x00ff) | (m_blitter_data[0x8]&0x0080) << 1;
- }
-
- if(offset==0x8 && ACCESSING_BITS_0_7)
- {
- xscroll = (m_blitter_data[0xa]&0x00ff) | (m_blitter_data[0x8]&0x0040) << 2;
- yscroll = (m_blitter_data[0xb]&0x00ff) | (m_blitter_data[0x8]&0x0080) << 1;
- }
-
- if(xscroll>=0)
- {
- int scl=m_current_scanline>=NUM_SCANLINES?0:m_current_scanline;
- m_scanlines[scl].x=xscroll;
- m_scanlines[scl].unkbits=m_blitter_data[0x8]&0xff;
- }
-
- if(yscroll>=0)
- {
- int scl=m_current_scanline>=NUM_SCANLINES?0:m_current_scanline;
- m_scanlines[scl].y=yscroll;
- m_scanlines[scl].unkbits=m_blitter_data[0x8]&0xff;
- }
-
-
if(offset==0xf && data==0xffff)
{
m_maincpu->set_input_line(1, HOLD_LINE);
@@ -557,7 +504,7 @@ WRITE16_MEMBER(wheelfir_state::wheelfir_blit_w)
}
else
{
- screen_y&=0xff;
+ if (vpage == LAYER_FG) screen_y&=0xff;
if(pix && screen_x >0 && screen_y >0 && screen_x < width && screen_y <height)
{
@@ -580,15 +527,14 @@ UINT32 wheelfir_state::screen_update_wheelfir(screen_device &screen, bitmap_ind1
{
bitmap.fill(0, cliprect);
- for(int y=0;y<NUM_SCANLINES;++y)
+ for(int y=cliprect.min_y; y < cliprect.max_y; y++)
{
UINT16 *source = &m_tmp_bitmap[LAYER_BG]->pix16(( (m_scanlines[y].y)&511));
UINT16 *dest = &bitmap.pix16(y);
- for (int x=0;x<336;x++)
+ for (int x = cliprect.min_x; x < cliprect.max_x; x++)
{
dest[x] = source[ (x+(m_scanlines[y].x)) &511];
-
}
}
@@ -638,19 +584,40 @@ WRITE16_MEMBER(wheelfir_state::pal_data_w)
WRITE16_MEMBER(wheelfir_state::wheelfir_7c0000_w)
{
- /* seems to be scanline width/2 (used for scanline int timing ? or real width of scanline ?) */
-}
+ if (ACCESSING_BITS_8_15)
+ {
+ //{UINT16 x = data & 0xf800; static int y = -1; if (x != y) { y = x; printf("%s wheelfir_7c0000_w %d%d%d%d%d\n", machine().describe_context(), BIT(data, 15), BIT(data, 14), BIT(data, 13), BIT(data, 12), BIT(data, 11)); }}
+ //{UINT16 x = data & 0x0700; static int y = -1; if (x != y) { y = x; printf("%s eeprom write %d%d%d\n", machine().describe_context(), BIT(data, 10), BIT(data, 9), BIT(data, 8)); }}
+ m_eeprom->di_write(BIT(data, 9));
+ m_eeprom->clk_write(BIT(data, 8));
+ m_eeprom->cs_write(BIT(data, 10));
+ }
-WRITE16_MEMBER(wheelfir_state::wheelfir_snd_w)
-{
- COMBINE_DATA(&m_soundlatch);
- m_subcpu->set_input_line(1, HOLD_LINE); /* guess, tested also with periodic interrupts and latch clear*/
- machine().scheduler().synchronize();
+ if (ACCESSING_BITS_0_7)
+ {
+ /// alternates between ac & ff
+ //printf("7c0001 %02x\n", data & 0xff);
+ /* seems to be scanline width/2 (used for scanline int timing ? or real width of scanline ?) */
+ }
}
-READ16_MEMBER(wheelfir_state::wheelfir_snd_r)
+READ16_MEMBER(wheelfir_state::wheelfir_7c0000_r)
{
- return m_soundlatch;
+ UINT16 data = 0;
+
+ if (ACCESSING_BITS_8_15)
+ {
+ data |= (machine().rand() & 0x2000); // ?
+ data |= m_eeprom->do_read() << 15;
+ //printf("%s eeprom read %04x %04x\n", machine().describe_context(), data, mem_mask);
+ }
+
+ if (ACCESSING_BITS_0_7)
+ {
+ //printf("unknown read %04x %04x\n", data, mem_mask);
+ }
+
+ return data;
}
WRITE16_MEMBER(wheelfir_state::coin_cnt_w)
@@ -660,7 +627,6 @@ WRITE16_MEMBER(wheelfir_state::coin_cnt_w)
machine().bookkeeping().coin_counter_w(1, data & 0x02);
}
-
static ADDRESS_MAP_START( wheelfir_main, AS_PROGRAM, 16, wheelfir_state )
AM_RANGE(0x000000, 0x0fffff) AM_ROM
AM_RANGE(0x200000, 0x20ffff) AM_RAM
@@ -669,26 +635,27 @@ static ADDRESS_MAP_START( wheelfir_main, AS_PROGRAM, 16, wheelfir_state )
AM_RANGE(0x720000, 0x720001) AM_WRITE(pal_reset_pos_w)
AM_RANGE(0x720002, 0x720003) AM_WRITE(pal_data_w)
AM_RANGE(0x720004, 0x720005) AM_WRITENOP // always ffff?
- AM_RANGE(0x740000, 0x740001) AM_WRITE(wheelfir_snd_w)
- AM_RANGE(0x780000, 0x78000f) AM_READNOP /* net comms ? */
+ AM_RANGE(0x740000, 0x740001) AM_DEVWRITE("soundlatch", generic_latch_16_device, write)
AM_RANGE(0x760000, 0x760001) AM_WRITE(coin_cnt_w)
+ AM_RANGE(0x780000, 0x780005) AM_WRITENOP // Start ADC0808 conversion
+ AM_RANGE(0x780000, 0x780001) AM_READ_PORT("STEERING")
+ AM_RANGE(0x780002, 0x780003) AM_READ_PORT("ACCELERATOR")
+ AM_RANGE(0x780004, 0x780005) AM_READ_PORT("BRAKE")
AM_RANGE(0x7a0000, 0x7a0001) AM_WRITE(wheelfir_scanline_cnt_w)
- AM_RANGE(0x7c0000, 0x7c0001) AM_READWRITE(wheelfir_status_r, wheelfir_7c0000_w)
+ AM_RANGE(0x7c0000, 0x7c0001) AM_READWRITE(wheelfir_7c0000_r, wheelfir_7c0000_w)
AM_RANGE(0x7e0000, 0x7e0001) AM_READ_PORT("P1")
AM_RANGE(0x7e0002, 0x7e0003) AM_READ_PORT("P2")
-
- ADDRESS_MAP_END
+ADDRESS_MAP_END
-/* sub is sound cpu? the program roms contain lots of samples */
static ADDRESS_MAP_START( wheelfir_sub, AS_PROGRAM, 16, wheelfir_state )
AM_RANGE(0x000000, 0x0fffff) AM_ROM
AM_RANGE(0x200000, 0x20ffff) AM_RAM
- AM_RANGE(0x780000, 0x780001) AM_READ(wheelfir_snd_r)
+ AM_RANGE(0x780000, 0x780001) AM_DEVREAD("soundlatch", generic_latch_16_device, read)
- AM_RANGE(0x700000, 0x700001) AM_DEVWRITE8("dac1", dac_device, write_unsigned8, 0xff00) //guess for now
- AM_RANGE(0x740000, 0x740001) AM_DEVWRITE8("dac2", dac_device, write_unsigned8, 0xff00)
+ AM_RANGE(0x700000, 0x700001) AM_DEVWRITE("ldac", dac_word_interface, write)
+ AM_RANGE(0x740000, 0x740001) AM_DEVWRITE("rdac", dac_word_interface, write)
ADDRESS_MAP_END
@@ -706,9 +673,7 @@ static INPUT_PORTS_START( wheelfir )
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_COIN2 )
- PORT_DIPNAME( 0x1000, 0x1000, "Test / Game?" )
- PORT_DIPSETTING( 0x1000, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
+ PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( "Test" )
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNUSED ) /* net comm flag ? */
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -723,50 +688,51 @@ static INPUT_PORTS_START( wheelfir )
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
+
+ PORT_START("STEERING")
+ PORT_BIT(0xff, 0x80, IPT_PADDLE) PORT_INVERT PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_NAME("Steering Wheel") PORT_REVERSE
+
+ PORT_START("ACCELERATOR")
+ PORT_BIT(0xff, 0x00, IPT_PEDAL) PORT_INVERT PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_NAME("Accelerator Pedal") PORT_MINMAX(0x00, 0xff) PORT_REVERSE
+
+ PORT_START("BRAKE")
+ PORT_BIT(0xff, 0x00, IPT_PEDAL2) PORT_INVERT PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_NAME("Brake Pedal") PORT_MINMAX(0x00, 0xff) PORT_REVERSE
INPUT_PORTS_END
TIMER_DEVICE_CALLBACK_MEMBER(wheelfir_state::scanline_timer_callback)
{
- machine().scheduler().synchronize();
- m_current_scanline=param;
-
- if(m_current_scanline<NUM_SCANLINES)
+ if(param<NUM_SCANLINES)
{
- //visible scanline
+ //copy scanline offset
+ int xscroll = (m_blitter_data[0xa] & 0x00ff) | (m_blitter_data[0x8] & 0x0040) << 2;
+ int yscroll = (m_blitter_data[0xb] & 0x00ff) | (m_blitter_data[0x8] & 0x0080) << 1;
- m_toggle_bit = 0x0000;
+ m_scanlines[param].x = xscroll;
+ m_scanlines[param].y = yscroll;
+ m_scanlines[param].unkbits = m_blitter_data[0x8] & 0xff;
- --m_scanline_cnt;
+ m_blitter_data[0xb]++;
- if(m_current_scanline>0)
- {
- //copy scanline offset
- m_scanlines[m_current_scanline].x=(m_scanlines[m_current_scanline-1].x);
- m_scanlines[m_current_scanline].y=(m_scanlines[m_current_scanline-1].y+1);
- m_scanlines[m_current_scanline].unkbits=m_scanlines[m_current_scanline-1].unkbits;
- }
-
- if(m_scanline_cnt==0) //<=0 ?
+ //visible scanline
+ m_scanline_cnt--;
+ if(m_scanline_cnt==0)
{
m_maincpu->set_input_line(5, HOLD_LINE); // raster IRQ, changes scroll values for road
}
-
+ //m_screen->update_partial(param);
}
else
{
- if(m_current_scanline==NUM_SCANLINES) /* vblank */
+ if(param==NUM_SCANLINES) /* vblank */
{
- m_toggle_bit = 0x8000;
m_maincpu->set_input_line(3, HOLD_LINE);
}
}
-}
-
-void wheelfir_state::machine_reset()
-{
+ m_subcpu->set_input_line(1, HOLD_LINE);
}
+
void wheelfir_state::machine_start()
{
m_zoom_table = std::make_unique<INT32[]>(ZOOM_TABLE_SIZE);
@@ -808,9 +774,8 @@ static MACHINE_CONFIG_START( wheelfir, wheelfir_state )
MCFG_CPU_ADD("subcpu", M68000, 32000000/2)
MCFG_CPU_PROGRAM_MAP(wheelfir_sub)
- //MCFG_CPU_PERIODIC_INT_DRIVER(wheelfir_state, irq1_line_hold, 256*60)
- MCFG_QUANTUM_TIME(attotime::from_hz(12000))
+ //MCFG_QUANTUM_TIME(attotime::from_hz(12000))
MCFG_TIMER_DRIVER_ADD_SCANLINE("scan_timer", wheelfir_state, scanline_timer_callback, "screen", 0, 1)
@@ -827,15 +792,15 @@ static MACHINE_CONFIG_START( wheelfir, wheelfir_state )
MCFG_EEPROM_SERIAL_93C46_ADD("eeprom")
-
+ MCFG_GENERIC_LATCH_16_ADD("soundlatch")
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
-
- MCFG_DAC_ADD("dac1")
- MCFG_DAC_ADD("dac2")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
-
+ MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_SOUND_ADD("ldac", DAC_10BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) // unknown DAC
+ MCFG_SOUND_ADD("rdac", DAC_10BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "ldac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "ldac", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "rdac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "rdac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
@@ -857,12 +822,9 @@ ROM_START( wheelfir )
ROM_LOAD( "tch9.u57", 0x280000, 0x80000, CRC(83c66de3) SHA1(50deaf3338d590340b928f891548c47ba8f3ca38) )
ROM_LOAD( "tch10.u58",0x300000, 0x80000, CRC(2036ed80) SHA1(910381e2ccdbc2d06f873021d8af02795d22f595) )
ROM_LOAD( "tch12.u59",0x380000, 0x80000, CRC(cce2e675) SHA1(f3d8916077b2e057169d0f254005cd959789a3b3) )
-ROM_END
-DRIVER_INIT_MEMBER(wheelfir_state,wheelfir)
-{
- UINT16 *RAM = (UINT16 *)memregion("maincpu")->base();
- RAM[0xdd3da/2] = 0x4e71; //hack
-}
+ ROM_REGION16_BE(0x80, "eeprom", 0)
+ ROM_LOAD16_WORD_SWAP( "eeprom", 0x000000, 0x000080, CRC(961e4bc9) SHA1(8944504bf56a272e9aa08185e73c6b4212d52383) )
+ROM_END
-GAME( 199?, wheelfir, 0, wheelfir, wheelfir, wheelfir_state, wheelfir, ROT0, "TCH", "Wheels & Fire", MACHINE_NOT_WORKING|MACHINE_NO_SOUND )
+GAME( 199?, wheelfir, 0, wheelfir, wheelfir, driver_device, 0, ROT0, "TCH", "Wheels & Fire", MACHINE_IMPERFECT_GRAPHICS)
diff --git a/src/mame/drivers/williams.cpp b/src/mame/drivers/williams.cpp
index 324fe044cfb..2489ed1de5c 100644
--- a/src/mame/drivers/williams.cpp
+++ b/src/mame/drivers/williams.cpp
@@ -503,6 +503,8 @@ Reference video: https://www.youtube.com/watch?v=R5OeC6Wc_yI
#include "emu.h"
#include "includes/williams.h"
#include "machine/nvram.h"
+#include "sound/dac.h"
+#include "sound/volt_reg.h"
#define MASTER_CLOCK (XTAL_12MHz)
@@ -1459,10 +1461,10 @@ static MACHINE_CONFIG_START( williams, williams_state )
MCFG_VIDEO_START_OVERRIDE(williams_state,williams)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
-
- MCFG_DAC_ADD("wmsdac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", MC1408, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) // mc1408.ic6
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
/* pia */
MCFG_DEVICE_ADD("pia_0", PIA6821, 0)
@@ -1476,7 +1478,7 @@ static MACHINE_CONFIG_START( williams, williams_state )
MCFG_PIA_IRQB_HANDLER(WRITELINE(williams_state, williams_main_irq))
MCFG_DEVICE_ADD("pia_2", PIA6821, 0)
- MCFG_PIA_WRITEPA_HANDLER(DEVWRITE8("wmsdac", dac_device, write_unsigned8))
+ MCFG_PIA_WRITEPA_HANDLER(DEVWRITE8("dac", dac_byte_interface, write))
MCFG_PIA_IRQA_HANDLER(WRITELINE(williams_state,williams_snd_irq))
MCFG_PIA_IRQB_HANDLER(WRITELINE(williams_state,williams_snd_irq))
MACHINE_CONFIG_END
@@ -1556,7 +1558,7 @@ static MACHINE_CONFIG_DERIVED( sinistar, williams )
/* sound hardware */
MCFG_SOUND_ADD("cvsd", HC55516, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.8)
/* pia */
MCFG_DEVICE_MODIFY("pia_0")
@@ -1578,7 +1580,7 @@ static MACHINE_CONFIG_DERIVED( playball, williams )
/* sound hardware */
MCFG_SOUND_ADD("cvsd", HC55516, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.8)
/* pia */
MCFG_DEVICE_MODIFY("pia_1")
@@ -1624,20 +1626,25 @@ static MACHINE_CONFIG_DERIVED( blaster, blastkit )
MCFG_DEVICE_MODIFY("pia_1")
MCFG_PIA_WRITEPB_HANDLER(WRITE8(blaster_state, blaster_snd_cmd_w))
+ MCFG_DEVICE_MODIFY("pia_2")
+ MCFG_PIA_WRITEPA_HANDLER(DEVWRITE8("ldac", dac_byte_interface, write))
+
MCFG_DEVICE_ADD("pia_2b", PIA6821, 0)
- MCFG_PIA_WRITEPA_HANDLER(DEVWRITE8("wmsdac_b", dac_device, write_unsigned8))
+ MCFG_PIA_WRITEPA_HANDLER(DEVWRITE8("rdac", dac_byte_interface, write))
MCFG_PIA_IRQA_HANDLER(WRITELINE(blaster_state,williams_snd_irq_b))
MCFG_PIA_IRQB_HANDLER(WRITELINE(blaster_state,williams_snd_irq_b))
/* sound hardware */
- MCFG_DEVICE_REMOVE("wmsdac")
- MCFG_DEVICE_REMOVE("mono")
+ MCFG_DEVICE_REMOVE("speaker")
+ MCFG_DEVICE_REMOVE("dac")
+ MCFG_DEVICE_REMOVE("vref")
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
- MCFG_DAC_ADD("wmsdac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.50)
- MCFG_DAC_ADD("wmsdac_b")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.50)
+ MCFG_SOUND_ADD("ldac", MC1408, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.25) // unknown DAC
+ MCFG_SOUND_ADD("rdac", MC1408, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.25) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "ldac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "ldac", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "rdac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "rdac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
@@ -1678,10 +1685,10 @@ static MACHINE_CONFIG_START( williams2, williams2_state )
MCFG_VIDEO_START_OVERRIDE(williams2_state,williams2)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
-
- MCFG_DAC_ADD("wmsdac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", MC1408, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
/* pia */
MCFG_DEVICE_ADD("pia_0", PIA6821, 0)
@@ -1698,7 +1705,7 @@ static MACHINE_CONFIG_START( williams2, williams2_state )
MCFG_DEVICE_ADD("pia_2", PIA6821, 0)
MCFG_PIA_WRITEPA_HANDLER(DEVWRITE8("pia_1", pia6821_device, portb_w))
- MCFG_PIA_WRITEPB_HANDLER(DEVWRITE8("wmsdac", dac_device, write_unsigned8))
+ MCFG_PIA_WRITEPB_HANDLER(DEVWRITE8("dac", dac_byte_interface, write))
MCFG_PIA_CA2_HANDLER(DEVWRITELINE("pia_1", pia6821_device, cb1_w))
MCFG_PIA_IRQA_HANDLER(WRITELINE(williams_state,williams_snd_irq))
MCFG_PIA_IRQB_HANDLER(WRITELINE(williams_state,williams_snd_irq))
@@ -1749,8 +1756,8 @@ static MACHINE_CONFIG_DERIVED_CLASS( joust2, williams2, joust2_state )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(williams2_d000_rom_map)
- MCFG_WILLIAMS_CVSD_SOUND_ADD("cvsd")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ADD("cvsd", WILLIAMS_CVSD_SOUND, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MCFG_MACHINE_START_OVERRIDE(joust2_state,joust2)
MCFG_MACHINE_RESET_OVERRIDE(joust2_state,joust2)
diff --git a/src/mame/drivers/wmg.cpp b/src/mame/drivers/wmg.cpp
index ecdf27c241e..ef0e3b3ca3a 100644
--- a/src/mame/drivers/wmg.cpp
+++ b/src/mame/drivers/wmg.cpp
@@ -72,6 +72,8 @@ of save-state is also needed.
#include "includes/williams.h"
#include "cpu/m6800/m6800.h"
#include "machine/nvram.h"
+#include "sound/dac.h"
+#include "sound/volt_reg.h"
#define MASTER_CLOCK (XTAL_12MHz)
#define SOUND_CLOCK (XTAL_3_579545MHz)
@@ -477,10 +479,11 @@ static MACHINE_CONFIG_START( wmg, wmg_state )
MCFG_VIDEO_START_OVERRIDE(williams_state,williams)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
- MCFG_DAC_ADD("wmsdac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ADD("dac", MC1408, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
/* pia */
MCFG_DEVICE_ADD("pia_0", PIA6821, 0)
@@ -495,7 +498,7 @@ static MACHINE_CONFIG_START( wmg, wmg_state )
MCFG_PIA_IRQB_HANDLER(WRITELINE(williams_state, williams_main_irq))
MCFG_DEVICE_ADD("pia_2", PIA6821, 0)
- MCFG_PIA_WRITEPA_HANDLER(DEVWRITE8("wmsdac", dac_device, write_unsigned8))
+ MCFG_PIA_WRITEPA_HANDLER(DEVWRITE8("dac", dac_byte_interface, write))
MCFG_PIA_IRQA_HANDLER(WRITELINE(williams_state,williams_snd_irq))
MCFG_PIA_IRQB_HANDLER(WRITELINE(williams_state,williams_snd_irq))
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/wpc_an.cpp b/src/mame/drivers/wpc_an.cpp
index 96e665aa08a..2f10e967a4e 100644
--- a/src/mame/drivers/wpc_an.cpp
+++ b/src/mame/drivers/wpc_an.cpp
@@ -329,13 +329,21 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_START( wpc_an, wpc_an_state )
MCFG_FRAGMENT_ADD(wpc_an_base)
- MCFG_WMS_WPC_SOUND_ADD("wpcsnd",":sound1")
+
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("wpcsnd", WPCSND, 0)
+ MCFG_WPC_ROM_REGION(":sound1")
MCFG_WPC_SOUND_REPLY_CALLBACK(WRITELINE(wpc_an_state,wpcsnd_reply_w))
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( wpc_an_dd, wpc_an_state )
MCFG_FRAGMENT_ADD(wpc_an_base)
- MCFG_WMS_S11C_BG_ADD("bg",":sound1")
+
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("bg", S11C_BG, 0)
+ MCFG_S11C_BG_ROM_REGION(":sound1")
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
/*-----------------
diff --git a/src/mame/drivers/wpc_dot.cpp b/src/mame/drivers/wpc_dot.cpp
index 4bd300c356a..98b5833d08b 100644
--- a/src/mame/drivers/wpc_dot.cpp
+++ b/src/mame/drivers/wpc_dot.cpp
@@ -311,8 +311,11 @@ static MACHINE_CONFIG_START( wpc_dot, wpc_dot_state )
MCFG_WPC_SOUND_DATA(READ8(wpc_dot_state,wpc_sound_data_r),WRITE8(wpc_dot_state,wpc_sound_data_w))
MCFG_WPC_DMDBANK(WRITE8(wpc_dot_state,wpc_dmdbank_w))
- MCFG_WMS_WPC_SOUND_ADD("wpcsnd",":sound1")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("wpcsnd", WPCSND, 0)
+ MCFG_WPC_ROM_REGION(":sound1")
MCFG_WPC_SOUND_REPLY_CALLBACK(WRITELINE(wpc_dot_state,wpcsnd_reply_w))
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MCFG_DEFAULT_LAYOUT(layout_lcd)
diff --git a/src/mame/drivers/wpc_flip1.cpp b/src/mame/drivers/wpc_flip1.cpp
index c907cf51de5..1330ae18ead 100644
--- a/src/mame/drivers/wpc_flip1.cpp
+++ b/src/mame/drivers/wpc_flip1.cpp
@@ -167,8 +167,11 @@ static MACHINE_CONFIG_START( wpc_flip1, wpc_flip1_state )
MCFG_WPC_SOUND_DATA(READ8(wpc_dot_state,wpc_sound_data_r),WRITE8(wpc_dot_state,wpc_sound_data_w))
MCFG_WPC_DMDBANK(WRITE8(wpc_dot_state,wpc_dmdbank_w))
- MCFG_WMS_WPC_SOUND_ADD("wpcsnd",":sound1")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("wpcsnd", WPCSND, 0)
+ MCFG_WPC_ROM_REGION(":sound1")
MCFG_WPC_SOUND_REPLY_CALLBACK(WRITELINE(wpc_dot_state,wpcsnd_reply_w))
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MCFG_DEFAULT_LAYOUT(layout_lcd)
diff --git a/src/mame/drivers/wpc_flip2.cpp b/src/mame/drivers/wpc_flip2.cpp
index 3b04999cab6..b2514c21971 100644
--- a/src/mame/drivers/wpc_flip2.cpp
+++ b/src/mame/drivers/wpc_flip2.cpp
@@ -196,8 +196,11 @@ static MACHINE_CONFIG_START( wpc_flip2, wpc_flip2_state )
MCFG_WPC_SOUND_DATA(READ8(wpc_dot_state,wpc_sound_data_r),WRITE8(wpc_dot_state,wpc_sound_data_w))
MCFG_WPC_DMDBANK(WRITE8(wpc_dot_state,wpc_dmdbank_w))
- MCFG_WMS_WPC_SOUND_ADD("wpcsnd",":sound1")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("wpcsnd", WPCSND, 0)
+ MCFG_WPC_ROM_REGION(":sound1")
MCFG_WPC_SOUND_REPLY_CALLBACK(WRITELINE(wpc_dot_state,wpcsnd_reply_w))
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MCFG_DEFAULT_LAYOUT(layout_lcd)
diff --git a/src/mame/drivers/xtheball.cpp b/src/mame/drivers/xtheball.cpp
index c1d22bcd585..1863a72a536 100644
--- a/src/mame/drivers/xtheball.cpp
+++ b/src/mame/drivers/xtheball.cpp
@@ -10,12 +10,12 @@
#include "emu.h"
#include "cpu/tms34010/tms34010.h"
-#include "video/tlc34076.h"
#include "machine/ticket.h"
#include "machine/nvram.h"
#include "machine/watchdog.h"
#include "sound/dac.h"
-
+#include "sound/volt_reg.h"
+#include "video/tlc34076.h"
class xtheball_state : public driver_device
{
@@ -248,7 +248,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, xtheball_state )
AM_RANGE(0x03040160, 0x0304016f) AM_READ_PORT("SERVICE")
AM_RANGE(0x03040170, 0x0304017f) AM_READ_PORT("SERVICE1")
AM_RANGE(0x03040180, 0x0304018f) AM_READ(analogy_watchdog_r)
- AM_RANGE(0x03060000, 0x0306000f) AM_DEVWRITE8("dac", dac_device, write_unsigned8, 0xff00)
+ AM_RANGE(0x03060000, 0x0306000f) AM_DEVWRITE8("dac", dac_byte_interface, write, 0xff00)
AM_RANGE(0x04000000, 0x057fffff) AM_ROM AM_REGION("user2", 0)
AM_RANGE(0xc0000000, 0xc00001ff) AM_DEVREADWRITE("maincpu", tms34010_device, io_register_r, io_register_w)
AM_RANGE(0xfff80000, 0xffffffff) AM_ROM AM_REGION("user1", 0)
@@ -360,10 +360,11 @@ static MACHINE_CONFIG_START( xtheball, xtheball_state )
MCFG_SCREEN_UPDATE_DEVICE("maincpu", tms34010_device, tms340x0_rgb32)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
- MCFG_DAC_ADD("dac")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/zaccaria.cpp b/src/mame/drivers/zaccaria.cpp
index 71aa07c5471..dc345153403 100644
--- a/src/mame/drivers/zaccaria.cpp
+++ b/src/mame/drivers/zaccaria.cpp
@@ -366,9 +366,9 @@ static MACHINE_CONFIG_START( zaccaria, zaccaria_state )
MCFG_PALETTE_INIT_OWNER(zaccaria_state, zaccaria)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_ZACCARIA_1B11142("audiopcb")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("audiopcb", ZACCARIA_1B11142, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/zaxxon.cpp b/src/mame/drivers/zaxxon.cpp
index 3da5c7365af..bd861f66f6e 100644
--- a/src/mame/drivers/zaxxon.cpp
+++ b/src/mame/drivers/zaxxon.cpp
@@ -939,7 +939,7 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( zaxxon, root )
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_FRAGMENT_ADD(zaxxon_samples)
MACHINE_CONFIG_END
@@ -976,7 +976,7 @@ static MACHINE_CONFIG_DERIVED( futspye, root )
MCFG_SCREEN_UPDATE_DRIVER(zaxxon_state, screen_update_futspy)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_FRAGMENT_ADD(zaxxon_samples)
MACHINE_CONFIG_END
@@ -1000,7 +1000,7 @@ static MACHINE_CONFIG_DERIVED( razmataze, root )
MCFG_SCREEN_UPDATE_DRIVER(zaxxon_state, screen_update_razmataz)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_SEGAUSBROM_ADD("usbsnd")
MACHINE_CONFIG_END
@@ -1038,15 +1038,15 @@ static MACHINE_CONFIG_DERIVED( congo, root )
MCFG_SCREEN_UPDATE_DRIVER(zaxxon_state, screen_update_congo)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_SOUND_ADD("sn1", SN76489A, SOUND_CLOCK) // schematic shows sn76489A
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MCFG_SOUND_ADD("sn2", SN76489A, SOUND_CLOCK/4) // schematic shows sn76489A
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MCFG_FRAGMENT_ADD(congo_samples)
MACHINE_CONFIG_END
diff --git a/src/mame/includes/advision.h b/src/mame/includes/advision.h
index 67182a92163..125d57443ed 100644
--- a/src/mame/includes/advision.h
+++ b/src/mame/includes/advision.h
@@ -33,7 +33,7 @@ public:
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_soundcpu;
- required_device<dac_device> m_dac;
+ required_device<dac_byte_interface> m_dac;
required_device<generic_slot_device> m_cart;
required_memory_bank m_bank1;
required_ioport m_joy;
diff --git a/src/mame/includes/alesis.h b/src/mame/includes/alesis.h
index c4bb2efa70e..6fb23198755 100644
--- a/src/mame/includes/alesis.h
+++ b/src/mame/includes/alesis.h
@@ -44,7 +44,7 @@ protected:
private:
static const device_timer_id TIMER_DAC_UPDATE = 1;
- required_device<dac_device> m_dac;
+ required_device<dac_word_interface> m_dac;
required_region_ptr<INT8> m_samples;
emu_timer * m_dac_update_timer;
diff --git a/src/mame/includes/apple2.h b/src/mame/includes/apple2.h
index 0216a80236e..bc5979fb60e 100644
--- a/src/mame/includes/apple2.h
+++ b/src/mame/includes/apple2.h
@@ -11,6 +11,7 @@
#ifndef APPLE2_H_
#define APPLE2_H_
+#include "emu.h"
#include "cpu/m6502/m6502.h"
#include "cpu/m6502/m65c02.h"
#include "bus/a2bus/a2bus.h"
diff --git a/src/mame/includes/apple3.h b/src/mame/includes/apple3.h
index 384989adf90..68ba39a40e2 100644
--- a/src/mame/includes/apple3.h
+++ b/src/mame/includes/apple3.h
@@ -19,7 +19,6 @@
#include "machine/6522via.h"
#include "machine/kb3600.h"
#include "machine/mm58167.h"
-#include "sound/speaker.h"
#include "sound/dac.h"
#include "machine/wozfdc.h"
#include "imagedev/floppy.h"
@@ -34,9 +33,6 @@
#define VAR_EXTPOWER 0x0040
#define VAR_EXTSIDE 0x0080
-#define SPEAKER_TAG "a3spkr"
-#define DAC_TAG "a3dac"
-
class apple3_state : public driver_device
{
public:
@@ -51,8 +47,8 @@ public:
m_ay3600(*this, "ay3600"),
m_a2bus(*this, "a2bus"),
m_rtc(*this, "rtc"),
- m_speaker(*this, SPEAKER_TAG),
- m_dac(*this, DAC_TAG),
+ m_bell(*this, "bell"),
+ m_dac(*this, "dac"),
m_kbspecial(*this, "keyb_special"),
m_palette(*this, "palette"),
m_joy1x(*this, "joy_1_x"),
@@ -77,8 +73,8 @@ public:
required_device<ay3600_device> m_ay3600;
required_device<a2bus_device> m_a2bus;
required_device<mm58167_device> m_rtc;
- required_device<speaker_sound_device> m_speaker;
- required_device<dac_device> m_dac;
+ required_device<dac_bit_interface> m_bell;
+ required_device<dac_byte_interface> m_dac;
required_ioport m_kbspecial;
required_device<palette_device> m_palette;
required_ioport m_joy1x, m_joy1y, m_joy2x, m_joy2y, m_joybuttons;
@@ -157,7 +153,7 @@ private:
UINT8 *m_bank2, *m_bank3, *m_bank4, *m_bank5, *m_bank8, *m_bank9;
UINT8 *m_bank10, *m_bank11;
UINT8 *m_bank6, *m_bank7rd, *m_bank7wr;
- int m_speaker_state;
+ int m_bell_state;
int m_c040_time;
UINT16 m_lastchar, m_strobe;
UINT8 m_transchar;
diff --git a/src/mame/includes/archimds.h b/src/mame/includes/archimds.h
index 9156fa255eb..8b818c27022 100644
--- a/src/mame/includes/archimds.h
+++ b/src/mame/includes/archimds.h
@@ -55,7 +55,9 @@ public:
m_region_maincpu(*this, "maincpu"),
m_region_vram(*this, "vram"),
m_screen(*this, "screen"),
- m_palette(*this, "palette") { }
+ m_palette(*this, "palette"),
+ m_dac(*this, { "dac0", "dac1", "dac2", "dac3", "dac4", "dac5", "dac6", "dac7" })
+ { }
optional_device<aakart_device> m_kart;
void archimedes_init();
@@ -103,7 +105,7 @@ protected:
required_memory_region m_region_vram;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
- dac_device *m_dac[8];
+ required_device_array<dac_word_interface, 8> m_dac;
private:
diff --git a/src/mame/includes/bw12.h b/src/mame/includes/bw12.h
index 39330c20fcb..24b6d39ce65 100644
--- a/src/mame/includes/bw12.h
+++ b/src/mame/includes/bw12.h
@@ -16,7 +16,6 @@
#include "machine/upd765.h"
#include "machine/z80dart.h"
#include "video/mc6845.h"
-#include "sound/dac.h"
#define SCREEN_TAG "screen"
#define Z80_TAG "ic35"
@@ -25,7 +24,6 @@
#define Z80SIO_TAG "ic15"
#define PIT8253_TAG "ic34"
#define PIA6821_TAG "ic16"
-#define MC1408_TAG "ic4"
#define AY3600PRO002_TAG "ic74"
#define CENTRONICS_TAG "centronics"
#define FLOPPY_TIMER_TAG "motor_off"
diff --git a/src/mame/includes/cchasm.h b/src/mame/includes/cchasm.h
index cc8ea7f0446..7389a213521 100644
--- a/src/mame/includes/cchasm.h
+++ b/src/mame/includes/cchasm.h
@@ -38,8 +38,8 @@ public:
required_device<cpu_device> m_maincpu;
required_device<z80ctc_device> m_ctc;
required_device<cpu_device> m_audiocpu;
- required_device<dac_device> m_dac1;
- required_device<dac_device> m_dac2;
+ required_device<dac_bit_interface> m_dac1;
+ required_device<dac_bit_interface> m_dac2;
required_device<vector_device> m_vector;
required_device<screen_device> m_screen;
required_device<generic_latch_8_device> m_soundlatch;
@@ -51,7 +51,6 @@ public:
int m_sound_flags;
int m_coin_flag;
- int m_channel_active[2];
int m_output[2];
int m_xcenter;
int m_ycenter;
diff --git a/src/mame/includes/champbas.h b/src/mame/includes/champbas.h
index c2f4a70dfb8..ca82f5db17c 100644
--- a/src/mame/includes/champbas.h
+++ b/src/mame/includes/champbas.h
@@ -8,7 +8,6 @@
#include "machine/alpha8201.h"
#include "machine/watchdog.h"
-#include "sound/dac.h"
class champbas_state : public driver_device
@@ -20,8 +19,6 @@ public:
m_audiocpu(*this, "audiocpu"),
m_alpha_8201(*this, "alpha_8201"),
m_watchdog(*this, "watchdog"),
- m_dac1(*this, "dac1"),
- m_dac2(*this, "dac2"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
m_mainram(*this, "mainram"),
@@ -35,8 +32,6 @@ public:
optional_device<cpu_device> m_audiocpu;
optional_device<alpha_8201_device> m_alpha_8201;
required_device<watchdog_timer_device> m_watchdog;
- optional_device<dac_device> m_dac1;
- optional_device<dac_device> m_dac2;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
@@ -62,9 +57,6 @@ public:
INTERRUPT_GEN_MEMBER(vblank_irq);
TIMER_DEVICE_CALLBACK_MEMBER(exctsccr_sound_irq);
- DECLARE_WRITE8_MEMBER(dac1_w);
- DECLARE_WRITE8_MEMBER(dac2_w);
-
DECLARE_WRITE8_MEMBER(tilemap_w);
DECLARE_WRITE8_MEMBER(gfxbank_w);
DECLARE_WRITE8_MEMBER(palette_bank_w);
diff --git a/src/mame/includes/cheekyms.h b/src/mame/includes/cheekyms.h
index 7957a0802f6..c413340d551 100644
--- a/src/mame/includes/cheekyms.h
+++ b/src/mame/includes/cheekyms.h
@@ -6,6 +6,7 @@
*************************************************************************/
+#include "sound/dac.h"
class cheekyms_state : public driver_device
{
@@ -13,7 +14,14 @@ public:
cheekyms_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
- m_dac(*this, "dac"),
+ m_dac0(*this, "dac0"),
+ m_dac1(*this, "dac1"),
+ m_dac2(*this, "dac2"),
+ m_dac3(*this, "dac3"),
+ m_dac4(*this, "dac4"),
+ m_dac5(*this, "dac5"),
+ m_dac6(*this, "dac6"),
+ m_dac7(*this, "dac7"),
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
m_palette(*this, "palette"),
@@ -23,7 +31,14 @@ public:
/* devices */
required_device<cpu_device> m_maincpu;
- required_device<dac_device> m_dac;
+ required_device<dac_bit_interface> m_dac0;
+ required_device<dac_bit_interface> m_dac1;
+ required_device<dac_bit_interface> m_dac2;
+ required_device<dac_bit_interface> m_dac3;
+ required_device<dac_bit_interface> m_dac4;
+ required_device<dac_bit_interface> m_dac5;
+ required_device<dac_bit_interface> m_dac6;
+ required_device<dac_bit_interface> m_dac7;
required_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
diff --git a/src/mame/includes/circusc.h b/src/mame/includes/circusc.h
index 782a605243d..86ed08bc4bc 100644
--- a/src/mame/includes/circusc.h
+++ b/src/mame/includes/circusc.h
@@ -47,7 +47,7 @@ public:
required_device<cpu_device> m_audiocpu;
required_device<sn76496_device> m_sn_1;
required_device<sn76496_device> m_sn_2;
- required_device<dac_device> m_dac;
+ required_device<dac_byte_interface> m_dac;
required_device<discrete_device> m_discrete;
UINT8 m_irq_mask;
diff --git a/src/mame/includes/coco.h b/src/mame/includes/coco.h
index 31b3d0445ba..41a05277905 100644
--- a/src/mame/includes/coco.h
+++ b/src/mame/includes/coco.h
@@ -49,7 +49,6 @@ SLOT_INTERFACE_EXTERN( coco_cart );
#define SAM_TAG "sam"
#define VDG_TAG "vdg"
#define SCREEN_TAG "screen"
-#define DAC_TAG "dac"
#define CARTRIDGE_TAG "ext"
#define RS232_TAG "rs232"
#define DWSOCK_TAG "dwsock"
@@ -93,7 +92,7 @@ public:
required_device<cpu_device> m_maincpu;
required_device<pia6821_device> m_pia_0;
required_device<pia6821_device> m_pia_1;
- required_device<dac_device> m_dac;
+ required_device<dac_byte_interface> m_dac;
required_device<wave_device> m_wave;
required_device<cococart_slot_device> m_cococart;
required_device<ram_device> m_ram;
diff --git a/src/mame/includes/coolpool.h b/src/mame/includes/coolpool.h
index 622f46dbe30..dc377c6c9eb 100644
--- a/src/mame/includes/coolpool.h
+++ b/src/mame/includes/coolpool.h
@@ -1,7 +1,10 @@
// license:BSD-3-Clause
// copyright-holders:Aaron Giles,Nicola Salmoria
#define NVRAM_UNLOCK_SEQ_LEN 10
-#include "sound/dac.h"
+
+#include "emu.h"
+#include "cpu/tms34010/tms34010.h"
+#include "video/tlc34076.h"
class coolpool_state : public driver_device
{
@@ -10,14 +13,12 @@ public:
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_dsp(*this, "dsp"),
- m_dac(*this, "dac"),
m_tlc34076(*this, "tlc34076"),
m_vram_base(*this, "vram_base"),
m_nvram(*this, "nvram") { }
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_dsp;
- required_device<dac_device> m_dac;
optional_device<tlc34076_device> m_tlc34076;
required_shared_ptr<UINT16> m_vram_base;
@@ -62,7 +63,6 @@ public:
DECLARE_READ16_MEMBER(dsp_rom_r);
DECLARE_WRITE16_MEMBER(dsp_romaddr_w);
DECLARE_READ16_MEMBER(coolpool_input_r);
- DECLARE_WRITE16_MEMBER(dsp_dac_w);
TMS340X0_TO_SHIFTREG_CB_MEMBER(to_shiftreg);
TMS340X0_FROM_SHIFTREG_CB_MEMBER(from_shiftreg);
TMS340X0_SCANLINE_RGB32_CB_MEMBER(amerdart_scanline);
diff --git a/src/mame/includes/cosmic.h b/src/mame/includes/cosmic.h
index 6a2058f0f58..7a17da42b7d 100644
--- a/src/mame/includes/cosmic.h
+++ b/src/mame/includes/cosmic.h
@@ -55,7 +55,7 @@ public:
/* devices */
required_device<cpu_device> m_maincpu;
optional_device<samples_device> m_samples;
- required_device<dac_device> m_dac;
+ optional_device<dac_bit_interface> m_dac;
optional_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
@@ -64,6 +64,7 @@ public:
DECLARE_WRITE8_MEMBER(panic_sound_output2_w);
DECLARE_WRITE8_MEMBER(cosmicg_output_w);
DECLARE_WRITE8_MEMBER(cosmica_sound_output_w);
+ DECLARE_WRITE8_MEMBER(dac_w);
DECLARE_READ8_MEMBER(cosmica_pixel_clock_r);
DECLARE_READ8_MEMBER(cosmicg_port_0_r);
DECLARE_READ8_MEMBER(magspot_coinage_dip_r);
@@ -71,7 +72,7 @@ public:
DECLARE_WRITE8_MEMBER(flip_screen_w);
DECLARE_WRITE8_MEMBER(cosmic_color_register_w);
DECLARE_WRITE8_MEMBER(cosmic_background_enable_w);
- DECLARE_INPUT_CHANGED_MEMBER(panic_coin_inserted);
+ DECLARE_WRITE_LINE_MEMBER(panic_coin_inserted);
DECLARE_INPUT_CHANGED_MEMBER(cosmica_coin_inserted);
DECLARE_INPUT_CHANGED_MEMBER(cosmicg_coin_inserted);
DECLARE_INPUT_CHANGED_MEMBER(coin_inserted_irq0);
diff --git a/src/mame/includes/cvs.h b/src/mame/includes/cvs.h
index 66d536c7116..7b22a12c1e6 100644
--- a/src/mame/includes/cvs.h
+++ b/src/mame/includes/cvs.h
@@ -75,8 +75,8 @@ public:
/* devices */
required_device<cpu_device> m_maincpu;
optional_device<cpu_device> m_audiocpu;
- optional_device<dac_device> m_dac2;
- optional_device<dac_device> m_dac3;
+ optional_device<dac_byte_interface> m_dac2;
+ optional_device<dac_bit_interface> m_dac3;
optional_device<tms5110_device> m_tms5110;
optional_device<s2636_device> m_s2636_0;
optional_device<s2636_device> m_s2636_1;
diff --git a/src/mame/includes/cyberbal.h b/src/mame/includes/cyberbal.h
index 1ad764daba9..ff2ed22e5c1 100644
--- a/src/mame/includes/cyberbal.h
+++ b/src/mame/includes/cyberbal.h
@@ -22,8 +22,8 @@ public:
m_audiocpu(*this, "audiocpu"),
m_extracpu(*this, "extra"),
m_daccpu(*this, "dac"),
- m_dac1(*this, "dac1"),
- m_dac2(*this, "dac2"),
+ m_rdac(*this, "rdac"),
+ m_ldac(*this, "ldac"),
m_soundcomm(*this, "soundcomm"),
m_jsa(*this, "jsa"),
m_playfield_tilemap(*this, "playfield"),
@@ -39,8 +39,8 @@ public:
optional_device<m6502_device> m_audiocpu;
optional_device<cpu_device> m_extracpu;
optional_device<cpu_device> m_daccpu;
- optional_device<dac_device> m_dac1;
- optional_device<dac_device> m_dac2;
+ optional_device<dac_word_interface> m_rdac;
+ optional_device<dac_word_interface> m_ldac;
optional_device<atari_sound_comm_device> m_soundcomm;
optional_device<atari_jsa_ii_device> m_jsa;
required_device<tilemap_device> m_playfield_tilemap;
diff --git a/src/mame/includes/equites.h b/src/mame/includes/equites.h
index 650b102187a..e41bcb21f6e 100644
--- a/src/mame/includes/equites.h
+++ b/src/mame/includes/equites.h
@@ -77,8 +77,8 @@ public:
required_device<alpha_8201_device> m_alpha_8201;
optional_device<cpu_device> m_fakemcu;
required_device<msm5232_device> m_msm;
- required_device<dac_device> m_dac_1;
- required_device<dac_device> m_dac_2;
+ required_device<dac_byte_interface> m_dac_1;
+ required_device<dac_byte_interface> m_dac_2;
required_device<generic_latch_8_device> m_soundlatch;
DECLARE_WRITE8_MEMBER(equites_c0f8_w);
diff --git a/src/mame/includes/esripsys.h b/src/mame/includes/esripsys.h
index 43994ec4ada..9ff17ac03b4 100644
--- a/src/mame/includes/esripsys.h
+++ b/src/mame/includes/esripsys.h
@@ -71,7 +71,6 @@ public:
UINT8 m_s_to_g_latch1;
UINT8 m_s_to_g_latch2;
UINT8 m_dac_msb;
- UINT8 m_dac_vol;
UINT8 m_tms_data;
std::unique_ptr<UINT8[]> m_fdt_a;
std::unique_ptr<UINT8[]> m_fdt_b;
@@ -111,7 +110,6 @@ public:
DECLARE_READ8_MEMBER(tms5220_r);
DECLARE_WRITE8_MEMBER(tms5220_w);
DECLARE_WRITE8_MEMBER(control_w);
- DECLARE_WRITE8_MEMBER(volume_dac_w);
DECLARE_WRITE8_MEMBER(esripsys_bg_intensity_w);
DECLARE_INPUT_CHANGED_MEMBER(keypad_interrupt);
DECLARE_INPUT_CHANGED_MEMBER(coin_interrupt);
@@ -124,7 +122,7 @@ public:
TIMER_CALLBACK_MEMBER(delayed_bank_swap);
TIMER_CALLBACK_MEMBER(hblank_start_callback);
TIMER_CALLBACK_MEMBER(hblank_end_callback);
- required_device<dac_device> m_dac;
+ required_device<dac_word_interface> m_dac;
required_device<screen_device> m_screen;
ESRIP_DRAW(esripsys_draw);
};
diff --git a/src/mame/includes/exidy.h b/src/mame/includes/exidy.h
index 594a7ad9873..2f0afba69f7 100644
--- a/src/mame/includes/exidy.h
+++ b/src/mame/includes/exidy.h
@@ -52,7 +52,7 @@ public:
required_device<cpu_device> m_maincpu;
- optional_device<dac_device> m_dac;
+ optional_device<dac_bit_interface> m_dac;
optional_device<samples_device> m_samples;
required_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen;
diff --git a/src/mame/includes/exterm.h b/src/mame/includes/exterm.h
index cf1f601913b..8da912409cb 100644
--- a/src/mame/includes/exterm.h
+++ b/src/mame/includes/exterm.h
@@ -5,8 +5,8 @@
Gottlieb Exterminator hardware
*************************************************************************/
-#include "sound/dac.h"
#include "cpu/tms32010/tms32010.h"
+#include "cpu/tms34010/tms34010.h"
class exterm_state : public driver_device
{
@@ -17,7 +17,6 @@ public:
m_audiocpu(*this, "audiocpu"),
m_audioslave(*this, "audioslave"),
m_slave(*this, "slave"),
- m_dac(*this, "dac"),
m_master_videoram(*this, "master_videoram"),
m_slave_videoram(*this, "slave_videoram") { }
@@ -25,7 +24,6 @@ public:
required_device<cpu_device> m_audiocpu;
required_device<cpu_device> m_audioslave;
required_device<tms34010_device> m_slave;
- required_device<dac_device> m_dac;
required_shared_ptr<UINT16> m_master_videoram;
required_shared_ptr<UINT16> m_slave_videoram;
@@ -35,7 +33,6 @@ public:
UINT8 m_master_sound_latch;
UINT8 m_slave_sound_latch;
UINT8 m_sound_control;
- UINT8 m_dac_value[2];
UINT16 m_last;
DECLARE_WRITE16_MEMBER(exterm_host_data_w);
@@ -50,7 +47,6 @@ public:
DECLARE_READ8_MEMBER(sound_nmi_to_slave_r);
DECLARE_WRITE8_MEMBER(sound_control_w);
DECLARE_WRITE8_MEMBER(ym2151_data_latch_w);
- DECLARE_WRITE8_MEMBER(sound_slave_dac_w);
DECLARE_PALETTE_INIT(exterm);
TIMER_CALLBACK_MEMBER(sound_delayed_w);
TIMER_DEVICE_CALLBACK_MEMBER(master_sound_nmi_callback);
diff --git a/src/mame/includes/fidelz80.h b/src/mame/includes/fidelz80.h
index d7dd2558b1d..6c540310715 100644
--- a/src/mame/includes/fidelz80.h
+++ b/src/mame/includes/fidelz80.h
@@ -8,7 +8,7 @@
******************************************************************************/
#include "emu.h"
-#include "sound/speaker.h"
+#include "sound/dac.h"
#include "sound/s14001a.h"
#include "bus/generic/slot.h"
#include "bus/generic/carts.h"
@@ -23,7 +23,7 @@ public:
m_inp_matrix(*this, "IN.%u", 0),
m_speech(*this, "speech"),
m_speech_rom(*this, "speech"),
- m_speaker(*this, "speaker"),
+ m_dac(*this, "dac"),
m_cart(*this, "cartslot"),
m_display_wait(33),
m_display_maxy(1),
@@ -35,7 +35,7 @@ public:
optional_ioport_array<11> m_inp_matrix; // max 11
optional_device<s14001a_device> m_speech;
optional_region_ptr<UINT8> m_speech_rom;
- optional_device<speaker_sound_device> m_speaker;
+ optional_device<dac_bit_interface> m_dac;
optional_device<generic_slot_device> m_cart;
// misc common
diff --git a/src/mame/includes/galaxian.h b/src/mame/includes/galaxian.h
index c55c82cfb52..ee742054c19 100644
--- a/src/mame/includes/galaxian.h
+++ b/src/mame/includes/galaxian.h
@@ -64,7 +64,7 @@ public:
required_device<cpu_device> m_maincpu;
optional_device<cpu_device> m_audiocpu;
optional_device<cpu_device> m_audio2;
- optional_device<dac_device> m_dac;
+ optional_device<dac_byte_interface> m_dac;
optional_device<ay8910_device> m_ay8910_0;
optional_device<ay8910_device> m_ay8910_1;
optional_device<ay8910_device> m_ay8910_2;
diff --git a/src/mame/includes/galeb.h b/src/mame/includes/galeb.h
index 0c25b29d759..32ff8a45193 100644
--- a/src/mame/includes/galeb.h
+++ b/src/mame/includes/galeb.h
@@ -9,6 +9,7 @@
#ifndef GALEB_H_
#define GALEB_H_
+#include "sound/dac.h"
class galeb_state : public driver_device
{
@@ -18,15 +19,32 @@ public:
m_video_ram(*this, "video_ram"),
m_maincpu(*this, "maincpu"),
m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette") { }
+ m_palette(*this, "palette"),
+ m_keyboard(*this, "LINE%u", 0),
+ m_dac(*this, "dac"),
+ m_dac_state(0)
+ {
+ }
required_shared_ptr<UINT8> m_video_ram;
- DECLARE_READ8_MEMBER(galeb_keyboard_r);
+ DECLARE_WRITE8_MEMBER(dac_w);
+ DECLARE_READ8_MEMBER(keyboard_r);
+ DECLARE_READ8_MEMBER(tape_status_r);
+ DECLARE_READ8_MEMBER(tape_data_r);
+ DECLARE_WRITE8_MEMBER(tape_data_w);
virtual void video_start() override;
UINT32 screen_update_galeb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
required_device<cpu_device> m_maincpu;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
+ required_ioport_array<8> m_keyboard;
+ required_device<dac_1bit_device> m_dac;
+
+protected:
+ virtual void machine_start() override;
+
+private:
+ int m_dac_state;
};
/*----------- defined in video/galeb.c -----------*/
diff --git a/src/mame/includes/gamecom.h b/src/mame/includes/gamecom.h
index b6f494918f6..2afe93a5546 100644
--- a/src/mame/includes/gamecom.h
+++ b/src/mame/includes/gamecom.h
@@ -281,9 +281,9 @@ private:
required_shared_ptr<UINT8> m_p_videoram;
required_shared_ptr<UINT8> m_p_nvram;
required_device<cpu_device> m_maincpu;
- required_device<dac_device> m_dac;
- required_device<dac_device> m_dac0;
- required_device<dac_device> m_dac1;
+ required_device<dac_byte_interface> m_dac;
+ required_device<dac_byte_interface> m_dac0;
+ required_device<dac_byte_interface> m_dac1;
required_device<generic_slot_device> m_cart1;
required_device<generic_slot_device> m_cart2;
required_memory_bank m_bank1;
diff --git a/src/mame/includes/gba.h b/src/mame/includes/gba.h
index efb8406778d..9f3446d3b86 100644
--- a/src/mame/includes/gba.h
+++ b/src/mame/includes/gba.h
@@ -16,10 +16,10 @@ public:
gba_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
- m_ladac(*this, "direct_a_left"),
- m_radac(*this, "direct_a_right"),
- m_lbdac(*this, "direct_b_left"),
- m_rbdac(*this, "direct_b_right"),
+ m_ldaca(*this, "ldaca"),
+ m_rdaca(*this, "rdaca"),
+ m_ldacb(*this, "ldacb"),
+ m_rdacb(*this, "rdacb"),
m_gbsound(*this, "custom"),
m_cart(*this, "cartslot"),
m_region_maincpu(*this, "maincpu"),
@@ -28,10 +28,10 @@ public:
{ }
required_device<cpu_device> m_maincpu;
- required_device<dac_device> m_ladac;
- required_device<dac_device> m_radac;
- required_device<dac_device> m_lbdac;
- required_device<dac_device> m_rbdac;
+ required_device<dac_byte_interface> m_ldaca;
+ required_device<dac_byte_interface> m_rdaca;
+ required_device<dac_byte_interface> m_ldacb;
+ required_device<dac_byte_interface> m_rdacb;
required_device<gameboy_sound_device> m_gbsound;
required_device<gba_cart_slot_device> m_cart;
diff --git a/src/mame/includes/gp32.h b/src/mame/includes/gp32.h
index 65ae4f28ed0..54dac50d19f 100644
--- a/src/mame/includes/gp32.h
+++ b/src/mame/includes/gp32.h
@@ -97,8 +97,8 @@ public:
m_s3c240x_ram(*this, "s3c240x_ram"),
m_maincpu(*this, "maincpu"),
m_smartmedia(*this, "smartmedia"),
- m_dac1(*this, "dac1"),
- m_dac2(*this, "dac2"),
+ m_ldac(*this, "ldac"),
+ m_rdac(*this, "rdac"),
m_nvram(*this, "nvram"),
m_io_in0(*this, "IN0"),
m_io_in1(*this, "IN1"),
@@ -187,8 +187,8 @@ public:
protected:
required_device<cpu_device> m_maincpu;
required_device<smartmedia_image_device> m_smartmedia;
- required_device<dac_device> m_dac1;
- required_device<dac_device> m_dac2;
+ required_device<dac_word_interface> m_ldac;
+ required_device<dac_word_interface> m_rdac;
required_device<nvram_device> m_nvram;
required_ioport m_io_in0;
required_ioport m_io_in1;
diff --git a/src/mame/includes/harddriv.h b/src/mame/includes/harddriv.h
index 58a430885bf..39dbe88462e 100644
--- a/src/mame/includes/harddriv.h
+++ b/src/mame/includes/harddriv.h
@@ -257,8 +257,8 @@ protected:
optional_device<adsp2105_device> m_ds3xdsp;
optional_memory_region m_ds3sdsp_region;
optional_memory_region m_ds3xdsp_region;
- optional_device<dac_device> m_ds3dac1;
- optional_device<dac_device> m_ds3dac2;
+ optional_device<dac_word_interface> m_ldac;
+ optional_device<dac_word_interface> m_rdac;
optional_device<harddriv_sound_board_device> m_harddriv_sound;
optional_device<atari_jsa_base_device> m_jsa;
optional_device<screen_device> m_screen;
@@ -317,8 +317,8 @@ protected:
required_ioport m_in0;
optional_ioport m_sw1;
required_ioport m_a80000;
- optional_ioport_array<8> m_8badc;
- optional_ioport_array<4> m_12badc;
+ required_ioport_array<8> m_8badc;
+ required_ioport_array<4> m_12badc;
/* machine state */
UINT8 m_irq_state;
@@ -497,7 +497,7 @@ protected:
private:
required_device<cpu_device> m_soundcpu;
- required_device<dac_device> m_dac;
+ required_device<dac_word_interface> m_dac;
required_device<cpu_device> m_sounddsp;
required_shared_ptr<UINT16> m_sounddsp_ram;
required_region_ptr<UINT8> m_sound_rom;
@@ -507,7 +507,6 @@ private:
UINT16 m_sounddata;
UINT16 m_maindata;
- UINT8 m_dacmute;
UINT8 m_cramen;
UINT8 m_irq68k;
diff --git a/src/mame/includes/homedata.h b/src/mame/includes/homedata.h
index 94b55813073..f2062f7eda3 100644
--- a/src/mame/includes/homedata.h
+++ b/src/mame/includes/homedata.h
@@ -2,7 +2,6 @@
// copyright-holders:Phil Stroffolino, Nicola Salmoria
#include "machine/gen_latch.h"
-#include "sound/dac.h"
#include "sound/sn76496.h"
#include "sound/2203intf.h"
@@ -15,7 +14,6 @@ public:
m_videoram(*this, "videoram"),
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
- m_dac(*this, "dac"),
m_ymsnd(*this, "ymsnd"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
@@ -53,7 +51,6 @@ public:
/* device */
required_device<cpu_device> m_maincpu;
optional_device<cpu_device> m_audiocpu;
- optional_device<dac_device> m_dac;
optional_device<ym2203_device> m_ymsnd;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
@@ -65,7 +62,6 @@ public:
DECLARE_WRITE8_MEMBER(mrokumei_keyboard_select_w);
DECLARE_READ8_MEMBER(mrokumei_sound_io_r);
DECLARE_WRITE8_MEMBER(mrokumei_sound_bank_w);
- DECLARE_WRITE8_MEMBER(mrokumei_sound_io_w);
DECLARE_WRITE8_MEMBER(mrokumei_sound_cmd_w);
DECLARE_READ8_MEMBER(reikaids_upd7807_porta_r);
DECLARE_WRITE8_MEMBER(reikaids_upd7807_porta_w);
diff --git a/src/mame/includes/hp48.h b/src/mame/includes/hp48.h
index 67aa83b2ae0..f34746878ef 100644
--- a/src/mame/includes/hp48.h
+++ b/src/mame/includes/hp48.h
@@ -103,7 +103,7 @@ public:
void hp48_update_annunciators();
void hp48_apply_modules();
required_device<cpu_device> m_maincpu;
- required_device<dac_device> m_dac;
+ required_device<dac_bit_interface> m_dac;
required_device<palette_device> m_palette;
void hp48_pulse_irq( int irq_line);
void hp48_rs232_start_recv_byte( UINT8 data );
diff --git a/src/mame/includes/jaguar.h b/src/mame/includes/jaguar.h
index 0caef91aa9d..689e1e09b9b 100644
--- a/src/mame/includes/jaguar.h
+++ b/src/mame/includes/jaguar.h
@@ -32,8 +32,8 @@ public:
m_maincpu(*this, "maincpu"),
m_gpu(*this, "gpu"),
m_dsp(*this, "dsp"),
- m_dac1(*this, "dac1"),
- m_dac2(*this, "dac2"),
+ m_ldac(*this, "ldac"),
+ m_rdac(*this, "rdac"),
m_cdrom(*this, "cdrom"),
m_nvram(*this, "nvram"),
m_rom_base(*this, "rom"),
@@ -73,8 +73,8 @@ public:
required_device<cpu_device> m_maincpu;
required_device<jaguargpu_cpu_device> m_gpu;
required_device<jaguardsp_cpu_device> m_dsp;
- required_device<dac_device> m_dac1;
- required_device<dac_device> m_dac2;
+ required_device<dac_word_interface> m_ldac;
+ required_device<dac_word_interface> m_rdac;
optional_device<cdrom_image_device> m_cdrom;
// memory
diff --git a/src/mame/includes/kchamp.h b/src/mame/includes/kchamp.h
index e4101fddb49..4636290f1f4 100644
--- a/src/mame/includes/kchamp.h
+++ b/src/mame/includes/kchamp.h
@@ -8,6 +8,7 @@
#include "machine/gen_latch.h"
#include "sound/msm5205.h"
+#include "sound/dac.h"
class kchamp_state : public driver_device
{
@@ -21,6 +22,7 @@ public:
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
m_msm(*this, "msm"),
+ m_dac(*this, "dac"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
m_soundlatch(*this, "soundlatch") { }
@@ -45,6 +47,7 @@ public:
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
optional_device<msm5205_device> m_msm;
+ optional_device<dac_8bit_r2r_device> m_dac;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
required_device<generic_latch_8_device> m_soundlatch;
diff --git a/src/mame/includes/kim1.h b/src/mame/includes/kim1.h
index e1e40b76afa..2f777e9bfed 100644
--- a/src/mame/includes/kim1.h
+++ b/src/mame/includes/kim1.h
@@ -17,7 +17,6 @@
#include "machine/mos6530.h"
#include "imagedev/cassette.h"
#include "formats/kim1_cas.h"
-#include "sound/dac.h"
//**************************************************************************
// TYPE DEFINITIONS
diff --git a/src/mame/includes/lazercmd.h b/src/mame/includes/lazercmd.h
index 58134751943..c34efcf8fef 100644
--- a/src/mame/includes/lazercmd.h
+++ b/src/mame/includes/lazercmd.h
@@ -28,7 +28,10 @@ public:
lazercmd_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
- m_dac(*this, "dac"),
+ m_dac0(*this, "dac0"),
+ m_dac1(*this, "dac1"),
+ m_dac2(*this, "dac2"),
+ m_dac3(*this, "dac3"),
m_videoram(*this, "videoram"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette")
@@ -36,7 +39,10 @@ public:
/* device */
required_device<s2650_device> m_maincpu;
- required_device<dac_device> m_dac;
+ optional_device<dac_bit_interface> m_dac0;
+ optional_device<dac_bit_interface> m_dac1;
+ required_device<dac_bit_interface> m_dac2;
+ required_device<dac_bit_interface> m_dac3;
/* memory pointers */
required_shared_ptr<UINT8> m_videoram;
@@ -50,7 +56,6 @@ public:
/* misc */
int m_timer_count;
UINT8 m_sense_state;
- UINT8 m_dac_data;
UINT8 m_attract;
DECLARE_WRITE8_MEMBER(lazercmd_ctrl_port_w);
diff --git a/src/mame/includes/leland.h b/src/mame/includes/leland.h
index 518db7366f4..1d79e064488 100644
--- a/src/mame/includes/leland.h
+++ b/src/mame/includes/leland.h
@@ -9,6 +9,7 @@
#include "machine/eepromser.h"
#include "sound/ym2151.h"
#include "sound/dac.h"
+#include "sound/ay8910.h"
#include "machine/pit8253.h"
#include "cpu/i86/i186.h"
@@ -36,6 +37,8 @@ public:
m_sound(*this, "custom"),
m_dac0(*this, "dac0"),
m_dac1(*this, "dac1"),
+ m_ay8910(*this, "ay8910"),
+ m_ay8912(*this, "ay8912"),
m_screen(*this, "screen"),
m_palette(*this, "palette") { }
@@ -44,8 +47,10 @@ public:
required_shared_ptr<UINT8> m_mainram;
required_device<eeprom_serial_93cxx_device> m_eeprom;
optional_device<leland_80186_sound_device> m_sound;
- optional_device<dac_device> m_dac0;
- optional_device<dac_device> m_dac1;
+ optional_device<dac_byte_interface> m_dac0;
+ optional_device<dac_byte_interface> m_dac1;
+ optional_device<ay8910_device> m_ay8910;
+ optional_device<ay8912_device> m_ay8912;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
@@ -223,16 +228,13 @@ public:
DECLARE_WRITE16_MEMBER(peripheral_w);
DECLARE_WRITE8_MEMBER(leland_80186_command_lo_w);
DECLARE_WRITE8_MEMBER(leland_80186_command_hi_w);
- DECLARE_READ16_MEMBER(main_to_sound_comm_r);
DECLARE_READ8_MEMBER(leland_80186_response_r);
- DECLARE_WRITE16_MEMBER(sound_to_main_comm_w);
DECLARE_WRITE16_MEMBER(dac_w);
DECLARE_WRITE16_MEMBER(ataxx_dac_control);
DECLARE_WRITE_LINE_MEMBER(pit0_2_w);
DECLARE_WRITE_LINE_MEMBER(pit1_0_w);
DECLARE_WRITE_LINE_MEMBER(pit1_1_w);
DECLARE_WRITE_LINE_MEMBER(pit1_2_w);
- DECLARE_WRITE_LINE_MEMBER(pit2_0_w);
DECLARE_WRITE_LINE_MEMBER(i80186_tmr0_w);
DECLARE_WRITE_LINE_MEMBER(i80186_tmr1_w);
protected:
@@ -248,14 +250,23 @@ protected:
TYPE_WSF
};
- required_device<dac_device> m_dac1;
- required_device<dac_device> m_dac2;
- required_device<dac_device> m_dac3;
- required_device<dac_device> m_dac4;
- optional_device<dac_device> m_dac5;
- optional_device<dac_device> m_dac6;
- optional_device<dac_device> m_dac7;
- optional_device<dac_device> m_dac8;
+ required_device<dac_byte_interface> m_dac1;
+ required_device<dac_byte_interface> m_dac2;
+ required_device<dac_byte_interface> m_dac3;
+ required_device<dac_byte_interface> m_dac4;
+ optional_device<dac_byte_interface> m_dac5;
+ optional_device<dac_byte_interface> m_dac6;
+ optional_device<dac_byte_interface> m_dac7;
+ optional_device<dac_byte_interface> m_dac8;
+ optional_device<dac_word_interface> m_dac9;
+ required_device<dac_byte_interface> m_dac1vol;
+ required_device<dac_byte_interface> m_dac2vol;
+ required_device<dac_byte_interface> m_dac3vol;
+ required_device<dac_byte_interface> m_dac4vol;
+ optional_device<dac_byte_interface> m_dac5vol;
+ optional_device<dac_byte_interface> m_dac6vol;
+ optional_device<dac_byte_interface> m_dac7vol;
+ optional_device<dac_byte_interface> m_dac8vol;
private:
void command_lo_sync(void *ptr, int param);
diff --git a/src/mame/includes/m72.h b/src/mame/includes/m72.h
index 29afaea26c7..ef37ee67ac8 100644
--- a/src/mame/includes/m72.h
+++ b/src/mame/includes/m72.h
@@ -53,7 +53,7 @@ public:
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_soundcpu;
optional_device<cpu_device> m_mcu;
- optional_device<dac_device> m_dac;
+ optional_device<dac_byte_interface> m_dac;
optional_device<m72_audio_device> m_audio;
required_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen;
diff --git a/src/mame/includes/mac.h b/src/mame/includes/mac.h
index 7426235eee1..4d727427d2e 100644
--- a/src/mame/includes/mac.h
+++ b/src/mame/includes/mac.h
@@ -31,7 +31,6 @@
#define MAC_539X_1_TAG "539x_1"
#define MAC_539X_2_TAG "539x_2"
#define MACKBD_TAG "mackbd"
-#define DAC_TAG "macdac"
// uncomment to run i8021 keyboard in original Mac/512(e)/Plus
//#define MAC_USE_EMULATED_KBD (1)
@@ -172,12 +171,15 @@ public:
m_mouse2(*this, "MOUSE2"),
m_keys(*this, "KEY%u", 0),
m_montype(*this, "MONTYPE"),
+ m_snd_enable(false),
+ m_main_buffer(true),
+ m_snd_vol(7),
m_vram(*this,"vram"),
m_vram16(*this,"vram16"),
m_via2_ca1_hack(0),
m_screen(*this, "screen"),
m_palette(*this, "palette"),
- m_dac(*this, DAC_TAG)
+ m_dac(*this, "dac")
{
}
@@ -306,6 +308,7 @@ public:
void pmu_exec();
void mac_adb_newaction(int state);
void set_adb_line(int linestate);
+ void update_volume();
DECLARE_READ16_MEMBER ( mac_via_r );
DECLARE_WRITE16_MEMBER ( mac_via_w );
@@ -417,7 +420,7 @@ private:
int m_via2_ca1_hack;
optional_device<screen_device> m_screen;
optional_device<palette_device> m_palette;
- optional_device<dac_device> m_dac;
+ optional_device<dac_8bit_pwm_device> m_dac;
public:
emu_timer *m_scanline_timer;
diff --git a/src/mame/includes/mappy.h b/src/mame/includes/mappy.h
index 8bbfcf8ff25..15229332d96 100644
--- a/src/mame/includes/mappy.h
+++ b/src/mame/includes/mappy.h
@@ -50,7 +50,7 @@ public:
required_device<cpu_device> m_subcpu;
optional_device<cpu_device> m_subcpu2;
required_device<namco_15xx_device> m_namco_15xx;
- optional_device<dac_device> m_dac;
+ optional_device<dac_byte_interface> m_dac;
required_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
@@ -89,7 +89,6 @@ public:
DECLARE_READ8_MEMBER(dipB_muxi);
DECLARE_WRITE8_MEMBER(out_mux);
DECLARE_WRITE8_MEMBER(out_lamps);
- DECLARE_WRITE8_MEMBER(grobda_DAC_w);
TILEMAP_MAPPER_MEMBER(superpac_tilemap_scan);
TILEMAP_MAPPER_MEMBER(mappy_tilemap_scan);
TILE_GET_INFO_MEMBER(superpac_get_tile_info);
diff --git a/src/mame/includes/meadows.h b/src/mame/includes/meadows.h
index f8c0e47fa94..c84b262c230 100644
--- a/src/mame/includes/meadows.h
+++ b/src/mame/includes/meadows.h
@@ -29,7 +29,7 @@ public:
required_device<s2650_device> m_maincpu;
optional_device<s2650_device> m_audiocpu;
- optional_device<dac_device> m_dac;
+ optional_device<dac_8bit_r2r_device> m_dac;
optional_device<samples_device> m_samples;
required_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen;
@@ -38,8 +38,6 @@ public:
optional_shared_ptr<UINT8> m_spriteram;
required_shared_ptr<UINT8> m_videoram;
- UINT8 m_dac_data;
- int m_dac_enable;
int m_channel;
int m_freq1;
int m_freq2;
@@ -71,7 +69,6 @@ public:
INTERRUPT_GEN_MEMBER(minferno_interrupt);
INTERRUPT_GEN_MEMBER(audio_interrupt);
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &clip);
- void meadows_sh_dac_w(int data);
void meadows_sh_update();
SAMPLES_START_CB_MEMBER(meadows_sh_start);
};
diff --git a/src/mame/includes/mikro80.h b/src/mame/includes/mikro80.h
index 441ca98bcda..49b77a3044f 100644
--- a/src/mame/includes/mikro80.h
+++ b/src/mame/includes/mikro80.h
@@ -11,6 +11,7 @@
#include "machine/i8255.h"
#include "imagedev/cassette.h"
+#include "sound/dac.h"
class mikro80_state : public driver_device
{
@@ -38,12 +39,14 @@ public:
m_io_line6(*this, "LINE6"),
m_io_line7(*this, "LINE7"),
m_io_line8(*this, "LINE8") ,
+ m_dac(*this, "dac"),
m_maincpu(*this, "maincpu") { }
required_shared_ptr<UINT8> m_cursor_ram;
required_shared_ptr<UINT8> m_video_ram;
int m_keyboard_mask;
int m_key_mask;
+ DECLARE_WRITE8_MEMBER(radio99_sound_w);
DECLARE_READ8_MEMBER(mikro80_8255_portb_r);
DECLARE_READ8_MEMBER(mikro80_8255_portc_r);
DECLARE_WRITE8_MEMBER(mikro80_8255_porta_w);
@@ -74,6 +77,7 @@ protected:
required_ioport m_io_line6;
required_ioport m_io_line7;
required_ioport m_io_line8;
+ optional_device<dac_bit_interface> m_dac;
required_device<cpu_device> m_maincpu;
};
diff --git a/src/mame/includes/msx.h b/src/mame/includes/msx.h
index 0c55ee18768..0e6d35b3287 100644
--- a/src/mame/includes/msx.h
+++ b/src/mame/includes/msx.h
@@ -213,7 +213,7 @@ private:
optional_device<v9958_device> m_v9958;
required_device<cassette_image_device> m_cassette;
required_device<ay8910_device> m_ay8910;
- required_device<dac_device> m_dac;
+ required_device<dac_bit_interface> m_dac;
optional_device<rp5c01_device> m_rtc;
address_space_config m_switched_device_as_config;
required_memory_region m_region_maincpu;
diff --git a/src/mame/includes/n8080.h b/src/mame/includes/n8080.h
index 9e5926ced41..1af5effdb0b 100644
--- a/src/mame/includes/n8080.h
+++ b/src/mame/includes/n8080.h
@@ -13,7 +13,8 @@ public:
m_colorram(*this, "colorram"),
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
- m_dac(*this, "dac"),
+ m_n8080_dac(*this, "n8080_dac"),
+ m_helifire_dac(*this, "helifire_dac"),
m_sn(*this, "snsnd"),
m_screen(*this, "screen"),
m_palette(*this, "palette") { }
@@ -52,7 +53,8 @@ public:
/* devices */
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
- required_device<dac_device> m_dac;
+ optional_device<dac_bit_interface> m_n8080_dac;
+ optional_device<dac_8bit_r2r_device> m_helifire_dac;
optional_device<sn76477_device> m_sn;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
@@ -71,7 +73,6 @@ public:
DECLARE_READ8_MEMBER(helifire_8035_external_ram_r);
DECLARE_READ8_MEMBER(helifire_8035_p2_r);
DECLARE_WRITE8_MEMBER(n8080_dac_w);
- DECLARE_WRITE8_MEMBER(helifire_dac_w);
DECLARE_WRITE8_MEMBER(helifire_sound_ctrl_w);
DECLARE_WRITE_LINE_MEMBER(n8080_inte_callback);
DECLARE_WRITE8_MEMBER(n8080_status_callback);
diff --git a/src/mame/includes/namcos1.h b/src/mame/includes/namcos1.h
index 7c0146bdaa7..a9c4722cc32 100644
--- a/src/mame/includes/namcos1.h
+++ b/src/mame/includes/namcos1.h
@@ -16,7 +16,8 @@ public:
m_mcu(*this, "mcu"),
m_c116(*this, "c116"),
m_c117(*this, "c117"),
- m_dac(*this, "dac"),
+ m_dac0(*this, "dac0"),
+ m_dac1(*this, "dac1"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
m_videoram(*this, "videoram"),
@@ -34,7 +35,8 @@ public:
required_device<cpu_device> m_mcu;
required_device<namco_c116_device> m_c116;
required_device<namco_c117_device> m_c117;
- required_device<dac_device> m_dac;
+ required_device<dac_8bit_r2r_device> m_dac0;
+ required_device<dac_8bit_r2r_device> m_dac1;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
@@ -49,10 +51,6 @@ public:
required_ioport m_io_dipsw;
- int m_dac0_value;
- int m_dac1_value;
- int m_dac0_gain;
- int m_dac1_gain;
int m_key_id;
int m_key_reg;
int m_key_rng;
@@ -80,8 +78,6 @@ public:
DECLARE_READ8_MEMBER(dsw_r);
DECLARE_WRITE8_MEMBER(coin_w);
DECLARE_WRITE8_MEMBER(dac_gain_w);
- DECLARE_WRITE8_MEMBER(dac0_w);
- DECLARE_WRITE8_MEMBER(dac1_w);
DECLARE_WRITE8_MEMBER(sound_bankswitch_w);
DECLARE_WRITE8_MEMBER(mcu_bankswitch_w);
DECLARE_WRITE8_MEMBER(mcu_patch_w);
@@ -138,8 +134,6 @@ public:
void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void screen_eof(screen_device &screen, bool state);
- void update_DACs();
- void init_DACs();
private:
inline void get_tile_info(tile_data &tileinfo,int tile_index,UINT8 *info_vram);
diff --git a/src/mame/includes/nbmj9195.h b/src/mame/includes/nbmj9195.h
index 6020b56fab7..ff7a918224c 100644
--- a/src/mame/includes/nbmj9195.h
+++ b/src/mame/includes/nbmj9195.h
@@ -8,7 +8,6 @@
#include "cpu/z80/tmpz84c011.h"
#include "machine/gen_latch.h"
-#include "sound/dac.h"
#define VRAM_MAX 2
@@ -27,8 +26,6 @@ public:
nbmj9195_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag) ,
m_maincpu(*this, "maincpu"),
- m_dac1(*this, "dac1"),
- m_dac2(*this, "dac2"),
m_screen(*this, "screen"),
m_palette(*this, "palette"),
m_soundlatch(*this, "soundlatch"),
@@ -36,8 +33,6 @@ public:
{ }
required_device<tmpz84c011_device> m_maincpu;
- required_device<dac_device> m_dac1;
- required_device<dac_device> m_dac2;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
required_device<generic_latch_8_device> m_soundlatch;
diff --git a/src/mame/includes/niyanpai.h b/src/mame/includes/niyanpai.h
index 4461b7b36c5..46fe555a6e8 100644
--- a/src/mame/includes/niyanpai.h
+++ b/src/mame/includes/niyanpai.h
@@ -1,7 +1,6 @@
// license:BSD-3-Clause
// copyright-holders:Takahiro Nogi
-#include "sound/dac.h"
#include "machine/gen_latch.h"
#include "machine/tmp68301.h"
@@ -19,16 +18,12 @@ public:
: driver_device(mconfig, type, tag) ,
m_maincpu(*this, "maincpu"),
m_tmp68301(*this, "tmp68301"),
- m_dac1(*this, "dac1"),
- m_dac2(*this, "dac2"),
m_screen(*this, "screen"),
m_palette(*this, "palette"),
m_soundlatch(*this, "soundlatch") { }
required_device<cpu_device> m_maincpu;
required_device<tmp68301_device> m_tmp68301;
- required_device<dac_device> m_dac1;
- required_device<dac_device> m_dac2;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
required_device<generic_latch_8_device> m_soundlatch;
diff --git a/src/mame/includes/rltennis.h b/src/mame/includes/rltennis.h
index 321a778d689..f62b5011c34 100644
--- a/src/mame/includes/rltennis.h
+++ b/src/mame/includes/rltennis.h
@@ -12,14 +12,14 @@ public:
rltennis_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
- m_dac_1(*this, "dac1"),
- m_dac_2(*this, "dac2"),
+ m_dac1(*this, "dac1"),
+ m_dac2(*this, "dac2"),
m_data760000(0), m_data740000(0), m_dac_counter(0), m_sample_rom_offset_1(0), m_sample_rom_offset_2(0),
m_offset_shift(0) { }
required_device<cpu_device> m_maincpu;
- required_device<dac_device> m_dac_1;
- required_device<dac_device> m_dac_2;
+ required_device<dac_byte_interface> m_dac1;
+ required_device<dac_byte_interface> m_dac2;
UINT16 m_blitter[RLT_NUM_BLITTER_REGS];
INT32 m_data760000;
diff --git a/src/mame/includes/s11.h b/src/mame/includes/s11.h
index 9d48924e595..009ea8edf44 100644
--- a/src/mame/includes/s11.h
+++ b/src/mame/includes/s11.h
@@ -9,6 +9,13 @@
#ifndef S11_H_
#define S11_H_
+#include "audio/s11c_bg.h"
+#include "machine/6821pia.h"
+#include "machine/genpin.h"
+#include "sound/dac.h"
+#include "sound/hc55516.h"
+#include "sound/ym2151.h"
+
// 6802/8 CPU's input clock is 4MHz
// but because it has an internal /4 divider, its E clock runs at 1/4 that frequency
#define E_CLOCK (XTAL_4MHz/4)
@@ -27,8 +34,6 @@ public:
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
m_bgcpu(*this, "bgcpu"),
- m_dac(*this, "dac"),
- m_dac1(*this, "dac1"),
m_hc55516(*this, "hc55516"),
m_pias(*this, "pias"),
m_pia21(*this, "pia21"),
@@ -42,8 +47,7 @@ public:
m_bg(*this, "bgm")
{ }
- DECLARE_READ8_MEMBER(dac_r);
- DECLARE_WRITE8_MEMBER(dac_w);
+ DECLARE_READ8_MEMBER(sound_r);
DECLARE_WRITE8_MEMBER(bank_w);
DECLARE_WRITE8_MEMBER(dig0_w);
DECLARE_WRITE8_MEMBER(dig1_w);
@@ -57,7 +61,6 @@ public:
DECLARE_WRITE8_MEMBER(pia34_pa_w);
DECLARE_WRITE8_MEMBER(pia34_pb_w);
DECLARE_WRITE_LINE_MEMBER(pia34_cb2_w);
- DECLARE_WRITE8_MEMBER(pia40_pa_w);
DECLARE_WRITE8_MEMBER(pia40_pb_w);
DECLARE_WRITE_LINE_MEMBER(pia40_cb2_w);
DECLARE_READ8_MEMBER(switch_r);
@@ -82,8 +85,6 @@ protected:
required_device<cpu_device> m_maincpu;
optional_device<cpu_device> m_audiocpu;
optional_device<cpu_device> m_bgcpu;
- optional_device<dac_device> m_dac;
- optional_device<dac_device> m_dac1;
optional_device<hc55516_device> m_hc55516;
optional_device<pia6821_device> m_pias;
required_device<pia6821_device> m_pia21;
diff --git a/src/mame/includes/segas24.h b/src/mame/includes/segas24.h
index 2b2d2361bef..957c40f9b5d 100644
--- a/src/mame/includes/segas24.h
+++ b/src/mame/includes/segas24.h
@@ -36,7 +36,7 @@ public:
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_subcpu;
- required_device<dac_device> m_dac;
+ required_device<dac_byte_interface> m_dac;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
required_shared_ptr<UINT16> m_generic_paletteram_16;
diff --git a/src/mame/includes/seicross.h b/src/mame/includes/seicross.h
index 999afd71092..d887816380b 100644
--- a/src/mame/includes/seicross.h
+++ b/src/mame/includes/seicross.h
@@ -1,6 +1,7 @@
// license:BSD-3-Clause
// copyright-holders:Nicola Salmoria
#include "machine/nvram.h"
+#include "sound/dac.h"
class seicross_state : public driver_device
{
@@ -9,6 +10,7 @@ public:
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_mcu(*this, "mcu"),
+ m_dac(*this, "dac"),
m_nvram(*this, "nvram"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
@@ -22,6 +24,7 @@ public:
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_mcu;
+ required_device<dac_byte_interface> m_dac;
optional_device<nvram_device> m_nvram;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
@@ -58,4 +61,6 @@ public:
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect );
void nvram_init(nvram_device &nvram, void *data, size_t size);
+
+ DECLARE_WRITE8_MEMBER(dac_w);
};
diff --git a/src/mame/includes/senjyo.h b/src/mame/includes/senjyo.h
index 39d42ea5b01..18d399c10d6 100644
--- a/src/mame/includes/senjyo.h
+++ b/src/mame/includes/senjyo.h
@@ -36,7 +36,7 @@ public:
/* devices */
required_device<cpu_device> m_maincpu;
required_device<z80pio_device> m_pio;
- required_device<dac_device> m_dac;
+ required_device<dac_byte_interface> m_dac;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
required_device<palette_device> m_radar_palette;
diff --git a/src/mame/includes/sorcerer.h b/src/mame/includes/sorcerer.h
index c3be02dcfe2..1c463a966ac 100644
--- a/src/mame/includes/sorcerer.h
+++ b/src/mame/includes/sorcerer.h
@@ -11,7 +11,6 @@
#include "emu.h"
#include "cpu/z80/z80.h"
-#include "sound/dac.h"
#include "sound/wave.h"
#include "machine/ay31015.h"
#include "bus/centronics/ctronics.h"
diff --git a/src/mame/includes/special.h b/src/mame/includes/special.h
index c6626ccf9ca..b3fb51a421e 100644
--- a/src/mame/includes/special.h
+++ b/src/mame/includes/special.h
@@ -99,7 +99,7 @@ public:
required_device<cpu_device> m_maincpu;
optional_device<i8255_device> m_ppi;
optional_device<fd1793_t> m_fdc;
- optional_device<dac_device> m_dac;
+ optional_device<dac_bit_interface> m_dac;
optional_device<pit8253_device> m_pit;
optional_device<cassette_image_device> m_cassette;
optional_device<ram_device> m_ram;
diff --git a/src/mame/includes/suna16.h b/src/mame/includes/suna16.h
index 094c95647af..a458c06f914 100644
--- a/src/mame/includes/suna16.h
+++ b/src/mame/includes/suna16.h
@@ -2,7 +2,6 @@
// copyright-holders:Luca Elia
#include "machine/gen_latch.h"
-#include "sound/dac.h"
class suna16_state : public driver_device
{
@@ -10,10 +9,6 @@ public:
suna16_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this,"maincpu"),
- m_dac1(*this, "dac1"),
- m_dac2(*this, "dac2"),
- m_dac3(*this, "dac3"),
- m_dac4(*this, "dac4"),
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
m_palette(*this, "palette"),
@@ -27,10 +22,6 @@ public:
{ }
required_device<cpu_device> m_maincpu;
- required_device<dac_device> m_dac1;
- required_device<dac_device> m_dac2;
- optional_device<dac_device> m_dac3;
- optional_device<dac_device> m_dac4;
required_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
@@ -52,8 +43,6 @@ public:
DECLARE_READ16_MEMBER(paletteram_r);
DECLARE_WRITE16_MEMBER(paletteram_w);
DECLARE_WRITE16_MEMBER(flipscreen_w);
- DECLARE_WRITE8_MEMBER(DAC1_w);
- DECLARE_WRITE8_MEMBER(DAC2_w);
// bestbest specific
DECLARE_WRITE16_MEMBER(bestbest_flipscreen_w);
@@ -66,8 +55,6 @@ public:
DECLARE_WRITE16_MEMBER(bssoccer_leds_w);
DECLARE_WRITE8_MEMBER(bssoccer_pcm_1_bankswitch_w);
DECLARE_WRITE8_MEMBER(bssoccer_pcm_2_bankswitch_w);
- DECLARE_WRITE8_MEMBER(bssoccer_DAC3_w);
- DECLARE_WRITE8_MEMBER(bssoccer_DAC4_w);
// uballoon specific
DECLARE_WRITE16_MEMBER(uballoon_leds_w);
diff --git a/src/mame/includes/suna8.h b/src/mame/includes/suna8.h
index f15725507f6..6c7f039017e 100644
--- a/src/mame/includes/suna8.h
+++ b/src/mame/includes/suna8.h
@@ -101,7 +101,6 @@ public:
DECLARE_WRITE8_MEMBER(brickzn_palbank_w);
DECLARE_WRITE8_MEMBER(brickzn_sprbank_w);
DECLARE_WRITE8_MEMBER(brickzn_rombank_w);
- DECLARE_WRITE8_MEMBER(brickzn_pcm_w);
DECLARE_WRITE8_MEMBER(brickzn_banked_paletteram_w);
// brickzn (newer sets)
DECLARE_WRITE8_MEMBER(brickzn_prot2_w);
diff --git a/src/mame/includes/taitosj.h b/src/mame/includes/taitosj.h
index 4d80ec8a9bb..c5fd9f30ca8 100644
--- a/src/mame/includes/taitosj.h
+++ b/src/mame/includes/taitosj.h
@@ -2,8 +2,9 @@
// copyright-holders:Nicola Salmoria
#include "machine/gen_latch.h"
-#include "sound/dac.h"
#include "sound/ay8910.h"
+#include "sound/discrete.h"
+#include "sound/dac.h"
class taitosj_state : public driver_device
{
@@ -28,6 +29,7 @@ public:
m_audiocpu(*this, "audiocpu"),
m_mcu(*this, "mcu"),
m_dac(*this, "dac"),
+ m_dacvol(*this, "dacvol"),
m_ay1(*this, "ay1"),
m_ay2(*this, "ay2"),
m_ay3(*this, "ay3"),
@@ -41,8 +43,6 @@ public:
const rectangle &, int, int *, rectangle *);
UINT8 m_input_port_4_f0;
UINT8 m_kikstart_gears[2];
- INT8 m_dac_out;
- UINT8 m_dac_vol;
required_shared_ptr<UINT8> m_videoram_1;
required_shared_ptr<UINT8> m_videoram_2;
required_shared_ptr<UINT8> m_videoram_3;
@@ -106,8 +106,7 @@ public:
DECLARE_CUSTOM_INPUT_MEMBER(kikstart_gear_r);
DECLARE_WRITE8_MEMBER(taitosj_sndnmi_msk_w);
DECLARE_WRITE8_MEMBER(input_port_4_f0_w);
- DECLARE_WRITE8_MEMBER(dac_out_w);
- DECLARE_WRITE8_MEMBER(dac_vol_w);
+ DECLARE_WRITE8_MEMBER(taitosj_dacvol_w);
DECLARE_DRIVER_INIT(alpinea);
DECLARE_DRIVER_INIT(alpine);
DECLARE_DRIVER_INIT(taitosj);
@@ -143,7 +142,8 @@ public:
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
optional_device<cpu_device> m_mcu;
- required_device<dac_device> m_dac;
+ required_device<dac_8bit_r2r_device> m_dac;
+ required_device<discrete_device> m_dacvol;
required_device<ay8910_device> m_ay1;
required_device<ay8910_device> m_ay2;
required_device<ay8910_device> m_ay3;
diff --git a/src/mame/includes/tceptor.h b/src/mame/includes/tceptor.h
index 5ec6d58a36d..26f5a122dc3 100644
--- a/src/mame/includes/tceptor.h
+++ b/src/mame/includes/tceptor.h
@@ -1,6 +1,5 @@
// license:BSD-3-Clause
// copyright-holders:BUT
-#include "sound/dac.h"
#include "sound/namco.h"
#include "video/c45.h"
@@ -11,7 +10,6 @@ public:
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_cus30(*this, "namco"),
- m_dac(*this, "dac"),
m_tile_ram(*this, "tile_ram"),
m_tile_attr(*this, "tile_attr"),
m_bg_ram(*this, "bg_ram"),
@@ -27,7 +25,6 @@ public:
UINT8 m_mcu_irq_enable;
required_device<cpu_device> m_maincpu;
required_device<namco_cus30_device> m_cus30;
- required_device<dac_device> m_dac;
required_shared_ptr<UINT8> m_tile_ram;
required_shared_ptr<UINT8> m_tile_attr;
required_shared_ptr<UINT8> m_bg_ram;
@@ -65,7 +62,6 @@ public:
DECLARE_WRITE8_MEMBER(tceptor_bg_ram_w);
DECLARE_WRITE8_MEMBER(tceptor_bg_scroll_w);
void tile_mark_dirty(int offset);
- DECLARE_WRITE8_MEMBER(voice_w);
required_device<namco_c45_road_device> m_c45_road;
required_device<screen_device> m_2dscreen;
diff --git a/src/mame/includes/thomson.h b/src/mame/includes/thomson.h
index 92ddeba8327..fdc51b12489 100644
--- a/src/mame/includes/thomson.h
+++ b/src/mame/includes/thomson.h
@@ -19,7 +19,7 @@
#include "machine/6850acia.h"
#include "machine/mos6551.h"
#include "sound/dac.h"
-#include "audio/mea8000.h"
+#include "sound/mea8000.h"
#include "bus/centronics/ctronics.h"
#include "imagedev/cassette.h"
#include "machine/mc6843.h"
@@ -101,7 +101,6 @@ public:
m_mc6854(*this, "mc6854"),
m_maincpu(*this, "maincpu"),
m_cassette(*this, "cassette"),
- m_buzzer(*this, "buzzer"),
m_dac(*this, "dac"),
m_centronics(*this, "centronics"),
m_cent_data_out(*this, "cent_data_out"),
@@ -155,9 +154,8 @@ public:
DECLARE_WRITE8_MEMBER( to7_cartridge_w );
DECLARE_READ8_MEMBER( to7_cartridge_r );
DECLARE_WRITE8_MEMBER( to7_timer_port_out );
- DECLARE_WRITE8_MEMBER( to7_timer_cp2_out );
DECLARE_READ8_MEMBER( to7_timer_port_in );
- DECLARE_WRITE8_MEMBER( to7_timer_tco_out );
+ DECLARE_WRITE_LINE_MEMBER( to7_set_cassette );
DECLARE_WRITE_LINE_MEMBER( to7_sys_cb2_out );
DECLARE_WRITE8_MEMBER( to7_sys_portb_out );
DECLARE_READ8_MEMBER( to7_sys_porta_in );
@@ -191,7 +189,6 @@ public:
TIMER_CALLBACK_MEMBER( mo5_periodic_cb );
DECLARE_WRITE8_MEMBER( mo5_sys_porta_out );
DECLARE_READ8_MEMBER( mo5_sys_porta_in );
- DECLARE_WRITE8_MEMBER( mo5_sys_portb_out );
DECLARE_READ8_MEMBER( mo5_sys_portb_in );
DECLARE_READ8_MEMBER( mo5_gatearray_r );
DECLARE_WRITE8_MEMBER( mo5_gatearray_w );
@@ -236,7 +233,7 @@ public:
DECLARE_WRITE8_MEMBER( to8_sys_portb_out );
DECLARE_READ8_MEMBER( to8_timer_port_in );
DECLARE_WRITE8_MEMBER( to8_timer_port_out );
- DECLARE_WRITE8_MEMBER( to8_timer_cp2_out );
+ DECLARE_WRITE_LINE_MEMBER( to8_timer_cp2_out );
void to8_lightpen_cb( int step );
DECLARE_MACHINE_RESET( to8 );
DECLARE_MACHINE_START( to8 );
@@ -256,7 +253,6 @@ public:
DECLARE_READ8_MEMBER( mo6_sys_porta_in );
DECLARE_READ8_MEMBER( mo6_sys_portb_in );
DECLARE_WRITE8_MEMBER( mo6_sys_porta_out );
- DECLARE_WRITE8_MEMBER( mo6_sys_portb_out );
DECLARE_WRITE_LINE_MEMBER( mo6_sys_cb2_out );
DECLARE_READ8_MEMBER( mo6_gatearray_r );
DECLARE_WRITE8_MEMBER( mo6_gatearray_w );
@@ -358,8 +354,7 @@ public:
protected:
required_device<cpu_device> m_maincpu;
required_device<cassette_image_device> m_cassette;
- required_device<dac_device> m_buzzer;
- required_device<dac_device> m_dac;
+ required_device<dac_byte_interface> m_dac;
optional_device<centronics_device> m_centronics;
optional_device<output_latch_device> m_cent_data_out;
required_device<pia6821_device> m_pia_sys;
@@ -513,7 +508,6 @@ protected:
void (thomson_state::*m_thom_init_cb)( int init );
int to7_get_cassette();
- void to7_set_cassette( int data );
int mo5_get_cassette();
void mo5_set_cassette( int data );
void thom_set_irq( int line, int state );
diff --git a/src/mame/includes/tnzs.h b/src/mame/includes/tnzs.h
index 3020bfc0ebc..64864f79c27 100644
--- a/src/mame/includes/tnzs.h
+++ b/src/mame/includes/tnzs.h
@@ -34,7 +34,6 @@ public:
m_subcpu(*this, "sub"),
m_mcu(*this, "mcu"),
m_seta001(*this, "spritegen"),
- m_dac(*this, "dac"),
m_samples(*this, "samples"),
m_palette(*this, "palette"),
m_soundlatch(*this, "soundlatch"),
@@ -58,7 +57,6 @@ public:
optional_device<cpu_device> m_subcpu;
optional_device<upi41_cpu_device> m_mcu;
optional_device<seta001_device> m_seta001;
- optional_device<dac_device> m_dac;
optional_device<samples_device> m_samples;
required_device<palette_device> m_palette;
optional_device<generic_latch_8_device> m_soundlatch;
@@ -114,7 +112,6 @@ public:
DECLARE_READ8_MEMBER(kageki_csport_r);
DECLARE_WRITE8_MEMBER(kageki_csport_w);
DECLARE_WRITE8_MEMBER(kabukiz_sound_bank_w);
- DECLARE_WRITE8_MEMBER(kabukiz_sample_w);
DECLARE_WRITE_LINE_MEMBER(irqhandler);
SAMPLES_START_CB_MEMBER(kageki_init_samples);
diff --git a/src/mame/includes/truco.h b/src/mame/includes/truco.h
index 917e184bc32..627514b74f9 100644
--- a/src/mame/includes/truco.h
+++ b/src/mame/includes/truco.h
@@ -17,7 +17,7 @@ public:
required_device<cpu_device> m_maincpu;
required_device<watchdog_timer_device> m_watchdog;
- required_device<dac_device> m_dac;
+ required_device<dac_bit_interface> m_dac;
required_shared_ptr<UINT8> m_videoram;
required_shared_ptr<UINT8> m_battery_ram;
diff --git a/src/mame/includes/trucocl.h b/src/mame/includes/trucocl.h
index f851f627130..3a72c8f9697 100644
--- a/src/mame/includes/trucocl.h
+++ b/src/mame/includes/trucocl.h
@@ -36,7 +36,7 @@ public:
UINT32 screen_update_trucocl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(trucocl_interrupt);
required_device<cpu_device> m_maincpu;
- required_device<dac_device> m_dac;
+ required_device<dac_byte_interface> m_dac;
required_device<gfxdecode_device> m_gfxdecode;
protected:
diff --git a/src/mame/includes/ut88.h b/src/mame/includes/ut88.h
index a394965f096..f71c43552a6 100644
--- a/src/mame/includes/ut88.h
+++ b/src/mame/includes/ut88.h
@@ -50,7 +50,7 @@ public:
required_device<cassette_image_device> m_cassette;
optional_device<i8255_device> m_ppi;
- optional_device<dac_device> m_dac;
+ optional_device<dac_bit_interface> m_dac;
DECLARE_READ8_MEMBER(ut88_keyboard_r);
DECLARE_WRITE8_MEMBER(ut88_keyboard_w);
DECLARE_WRITE8_MEMBER(ut88_sound_w);
diff --git a/src/mame/includes/vectrex.h b/src/mame/includes/vectrex.h
index 351e76c3f87..b76cdd6cdd4 100644
--- a/src/mame/includes/vectrex.h
+++ b/src/mame/includes/vectrex.h
@@ -126,7 +126,7 @@ protected:
required_device<cpu_device> m_maincpu;
required_device<via6522_device> m_via6522_0;
- required_device<dac_device> m_dac;
+ required_device<dac_byte_interface> m_dac;
required_device<ay8910_device> m_ay8912;
required_device<vector_device> m_vector;
optional_device<vectrex_cart_slot_device> m_cart;
diff --git a/src/mame/includes/vidbrain.h b/src/mame/includes/vidbrain.h
index f9c8aa789cc..7ff38b6b57a 100644
--- a/src/mame/includes/vidbrain.h
+++ b/src/mame/includes/vidbrain.h
@@ -11,7 +11,6 @@
#include "machine/f3853.h"
#include "machine/ram.h"
#include "sound/dac.h"
-#include "sound/discrete.h"
#include "video/uv201.h"
#define F3850_TAG "cd34"
@@ -19,8 +18,6 @@
#define F3870_TAG "f3870"
#define UV201_TAG "uv201"
#define SCREEN_TAG "screen"
-#define DISCRETE_TAG "discrete"
-#define DAC_TAG "dac"
class vidbrain_state : public driver_device
{
@@ -30,8 +27,7 @@ public:
m_maincpu(*this, F3850_TAG),
m_smi(*this, F3853_TAG),
m_uv(*this, UV201_TAG),
- m_discrete(*this, DISCRETE_TAG),
- m_dac(*this, DAC_TAG),
+ m_dac(*this, "dac"),
m_exp(*this, VIDEOBRAIN_EXPANSION_SLOT_TAG),
m_io(*this, "IO%02u", 0),
m_uv201_31(*this, "UV201-31"),
@@ -49,8 +45,7 @@ public:
required_device<cpu_device> m_maincpu;
required_device<f3853_device> m_smi;
required_device<uv201_device> m_uv;
- required_device<discrete_sound_device> m_discrete;
- required_device<dac_device> m_dac;
+ required_device<dac_byte_interface> m_dac;
required_device<videobrain_expansion_slot_device> m_exp;
required_ioport_array<8> m_io;
required_ioport m_uv201_31;
diff --git a/src/mame/includes/williams.h b/src/mame/includes/williams.h
index 11096569c13..b7320461784 100644
--- a/src/mame/includes/williams.h
+++ b/src/mame/includes/williams.h
@@ -9,7 +9,6 @@
#include "cpu/m6809/m6809.h"
#include "cpu/m6800/m6800.h"
-#include "sound/dac.h"
#include "sound/hc55516.h"
#include "machine/ticket.h"
#include "machine/watchdog.h"
diff --git a/src/mame/machine/advision.cpp b/src/mame/machine/advision.cpp
index c41aaeff84d..792cf6b0719 100644
--- a/src/mame/machine/advision.cpp
+++ b/src/mame/machine/advision.cpp
@@ -11,7 +11,6 @@
#include "emu.h"
#include "includes/advision.h"
#include "cpu/mcs48/mcs48.h"
-#include "sound/dac.h"
/*
8048 Ports:
@@ -117,12 +116,8 @@ READ8_MEMBER( advision_state::sound_cmd_r )
void advision_state::update_dac()
{
- if (m_sound_g == 0 && m_sound_d == 0)
- m_dac->write_unsigned8(0xff);
- else if (m_sound_g == 1 && m_sound_d == 1)
- m_dac->write_unsigned8(0x80);
- else
- m_dac->write_unsigned8(0x00);
+ int translate[] = { 2, 0, 0, 1 };
+ m_dac->write(translate[(m_sound_g << 1) | m_sound_d]);
}
WRITE8_MEMBER( advision_state::sound_g_w )
diff --git a/src/mame/machine/apple3.cpp b/src/mame/machine/apple3.cpp
index f5e4ebb2fdc..1edd8fdbbd8 100644
--- a/src/mame/machine/apple3.cpp
+++ b/src/mame/machine/apple3.cpp
@@ -128,8 +128,8 @@ READ8_MEMBER(apple3_state::apple3_c0xx_r)
case 0x34: case 0x35: case 0x36: case 0x37:
case 0x38: case 0x39: case 0x3A: case 0x3B:
case 0x3C: case 0x3D: case 0x3E: case 0x3F:
- m_speaker_state ^= 1;
- m_speaker->level_w(m_speaker_state);
+ m_bell_state ^= 1;
+ m_bell->write(m_bell_state);
break;
case 0x40: case 0x41: case 0x42: case 0x43:
@@ -332,8 +332,8 @@ WRITE8_MEMBER(apple3_state::apple3_c0xx_w)
case 0x34: case 0x35: case 0x36: case 0x37:
case 0x38: case 0x39: case 0x3A: case 0x3B:
case 0x3C: case 0x3D: case 0x3E: case 0x3F:
- m_speaker_state ^= 1;
- m_speaker->level_w(m_speaker_state);
+ m_bell_state ^= 1;
+ m_bell->write(m_bell_state);
break;
case 0x40: case 0x41: case 0x42: case 0x43:
@@ -617,7 +617,7 @@ WRITE8_MEMBER(apple3_state::apple3_via_1_out_a)
WRITE8_MEMBER(apple3_state::apple3_via_1_out_b)
{
- m_dac->write_unsigned8(data<<2);
+ m_dac->write(data);
apple3_via_out(&m_via_1_b, data);
}
@@ -663,8 +663,8 @@ MACHINE_RESET_MEMBER(apple3_state,apple3)
{
m_indir_bank = 0;
m_sync = false;
- m_speaker_state = 0;
- m_speaker->level_w(0);
+ m_bell_state = 0;
+ m_bell->write(m_bell_state);
m_c040_time = 0;
m_strobe = 0;
m_lastchar = 0x0d;
@@ -759,7 +759,7 @@ DRIVER_INIT_MEMBER(apple3_state,apple3)
save_item(NAME(m_sync));
save_item(NAME(m_indir_bank));
save_item(NAME(m_cnxx_slot));
- save_item(NAME(m_speaker_state));
+ save_item(NAME(m_bell_state));
save_item(NAME(m_c040_time));
save_item(NAME(m_lastchar));
save_item(NAME(m_strobe));
@@ -1085,8 +1085,8 @@ TIMER_DEVICE_CALLBACK_MEMBER(apple3_state::apple3_c040_tick)
{
if (m_c040_time > 0)
{
- m_speaker_state ^= 1;
- m_speaker->level_w(m_speaker_state);
+ m_bell_state ^= 1;
+ m_bell->write(m_bell_state);
m_c040_time--;
}
}
diff --git a/src/mame/machine/archimds.cpp b/src/mame/machine/archimds.cpp
index 38b6785b307..a82c38c91c9 100644
--- a/src/mame/machine/archimds.cpp
+++ b/src/mame/machine/archimds.cpp
@@ -212,7 +212,7 @@ void archimedes_state::vidc_audio_tick()
res = mulawTable[ulaw_comp];
- m_dac[ch & 7]->write_signed16(res^0x8000);
+ m_dac[ch & 7]->write(res);
}
m_vidc_sndcur+=8;
@@ -227,7 +227,7 @@ void archimedes_state::vidc_audio_tick()
m_snd_timer->adjust(attotime::never);
for(ch=0;ch<8;ch++)
{
- m_dac[ch & 7]->write_signed16(0x8000);
+ m_dac[ch & 7]->write(0);
}
}
}
@@ -293,8 +293,6 @@ void archimedes_state::archimedes_reset()
void archimedes_state::archimedes_init()
{
- static const char *const dac_names[8] = { "dac0", "dac1", "dac2", "dac3", "dac4", "dac5", "dac6", "dac7" };
-
m_memc_pagesize = 0;
m_vbl_timer = timer_alloc(TIMER_VBLANK);
@@ -312,11 +310,6 @@ void archimedes_state::archimedes_init()
m_vid_timer = timer_alloc(TIMER_VIDEO);
m_snd_timer = timer_alloc(TIMER_AUDIO);
m_snd_timer->adjust(attotime::never);
-
- for ( int i = 0; i < 8; i++ )
- {
- m_dac[i] = machine().device<dac_device>(dac_names[i]);
- }
}
READ32_MEMBER(archimedes_state::archimedes_memc_logical_r)
diff --git a/src/mame/machine/at.cpp b/src/mame/machine/at.cpp
index a3c903e8b56..fe5e4bf790b 100644
--- a/src/mame/machine/at.cpp
+++ b/src/mame/machine/at.cpp
@@ -11,7 +11,6 @@
#include "cpu/i386/i386.h"
#include "machine/at_keybc.h"
#include "bus/pc_kbd/pc_kbdc.h"
-#include "sound/dac.h"
#include "softlist_dev.h"
#define LOG_PORT80 0
diff --git a/src/mame/machine/coco.cpp b/src/mame/machine/coco.cpp
index 5d2cd2e4a6d..beb835077ef 100644
--- a/src/mame/machine/coco.cpp
+++ b/src/mame/machine/coco.cpp
@@ -83,7 +83,7 @@ coco_state::coco_state(const machine_config &mconfig, device_type type, const ch
m_maincpu(*this, MAINCPU_TAG),
m_pia_0(*this, PIA0_TAG),
m_pia_1(*this, PIA1_TAG),
- m_dac(*this, DAC_TAG),
+ m_dac(*this, "dac"),
m_wave(*this, WAVE_TAG),
m_cococart(*this, CARTRIDGE_TAG),
m_ram(*this, RAM_TAG),
@@ -692,7 +692,7 @@ void coco_state::update_sound(void)
m_analog_audio_level = dac_sound + cassette_sound + cart_sound;
}
- m_dac->write_unsigned8(single_bit_sound + m_analog_audio_level);
+ m_dac->write(single_bit_sound + m_analog_audio_level);
/* determine the cassette sound status */
cassette_state cas_sound = bCassSoundEnable ? CASSETTE_SPEAKER_ENABLED : CASSETTE_SPEAKER_MUTED;
diff --git a/src/mame/machine/gamecom.cpp b/src/mame/machine/gamecom.cpp
index 03cf2786152..24e9a238ada 100644
--- a/src/mame/machine/gamecom.cpp
+++ b/src/mame/machine/gamecom.cpp
@@ -27,9 +27,7 @@ TIMER_CALLBACK_MEMBER(gamecom_state::gamecom_sound0_timer_callback)
}
if (m_sound0_cnt < 0x40)
{
- bool which_half = BIT(m_sound0_cnt, 0);
- UINT8 sb = m_sound.sg0w[m_sound0_cnt >> 1];
- m_dac0->write_signed8(which_half ? sb & 0xf0 : sb << 4);
+ m_dac0->write((m_sound.sg0w[m_sound0_cnt >> 1] >> (BIT(m_sound0_cnt, 0) * 4)) & 0xf);
m_sound0_cnt++;
}
}
@@ -47,9 +45,7 @@ TIMER_CALLBACK_MEMBER(gamecom_state::gamecom_sound1_timer_callback)
}
if (m_sound1_cnt < 0x40)
{
- bool which_half = BIT(m_sound1_cnt, 0);
- UINT8 sb = m_sound.sg1w[m_sound1_cnt >> 1];
- m_dac1->write_signed8(which_half ? sb & 0xf0 : sb << 4);
+ m_dac1->write((m_sound.sg1w[m_sound1_cnt >> 1] >> (BIT(m_sound1_cnt, 0) * 4)) & 0xf);
m_sound1_cnt++;
}
}
@@ -402,7 +398,7 @@ WRITE8_MEMBER( gamecom_state::gamecom_internal_w )
case SM8521_SGDA:
m_sound.sgda = data;
if((m_sound.sgc & 0x88) == 0x88)
- m_dac->write_unsigned8(data);
+ m_dac->write(data);
break;
case SM8521_SG0W0:
diff --git a/src/mame/machine/harddriv.cpp b/src/mame/machine/harddriv.cpp
index 50b3124e585..46e075d1414 100644
--- a/src/mame/machine/harddriv.cpp
+++ b/src/mame/machine/harddriv.cpp
@@ -7,7 +7,6 @@
****************************************************************************/
#include "emu.h"
-#include "sound/dac.h"
#include "includes/slapstic.h"
#include "includes/harddriv.h"
@@ -269,15 +268,15 @@ READ16_MEMBER( harddriv_state::hda68k_port1_r )
READ16_MEMBER( harddriv_state::hdc68k_wheel_r )
{
- /* grab the new wheel value and upconvert to 12 bits */
- UINT16 new_wheel = m_12badc[0].read_safe(0xffff) << 4;
+ /* grab the new wheel value */
+ UINT16 new_wheel = m_12badc[0].read_safe(0xffff);
/* hack to display the wheel position */
if (space.machine().input().code_pressed(KEYCODE_LSHIFT))
popmessage("%04X", new_wheel);
/* if we crossed the center line, latch the edge bit */
- if ((m_hdc68k_last_wheel / 0xf0) != (new_wheel / 0xf0))
+ if ((m_hdc68k_last_wheel / 0xf00) != (new_wheel / 0xf00))
m_hdc68k_wheel_edge = 1;
/* remember the last value and return the low 8 bits */
@@ -328,7 +327,7 @@ WRITE16_MEMBER( harddriv_state::hd68k_adc_control_w )
if (m_adc_control & 0x40)
{
m_adc12_select = (m_adc_control >> 4) & 0x03;
- m_adc12_data = m_12badc[m_adc12_select].read_safe(0xffff) << 4;
+ m_adc12_data = m_12badc[m_adc12_select].read_safe(0xffff);
}
/* bit 7 selects which byte of the 12 bit data to read */
@@ -1123,11 +1122,11 @@ WRITE16_MEMBER( harddriv_state::hdds3_sdsp_special_w )
break;
case 4:
- m_ds3dac1->write_signed16(data);
+ m_ldac->write(data);
break;
case 5:
- m_ds3dac2->write_signed16(data);
+ m_rdac->write(data);
break;
case 6:
diff --git a/src/mame/machine/hp48.cpp b/src/mame/machine/hp48.cpp
index 106e6a5f01b..21b5be8c42d 100644
--- a/src/mame/machine/hp48.cpp
+++ b/src/mame/machine/hp48.cpp
@@ -9,7 +9,6 @@
**********************************************************************/
#include "emu.h"
-#include "sound/dac.h"
#include "cpu/saturn/saturn.h"
#include "machine/nvram.h"
@@ -169,7 +168,7 @@ WRITE32_MEMBER( hp48_state::hp48_reg_out )
/* bits 9-10: unused */
/* bit 11: beeper */
- m_dac->write_unsigned8((data & 0x800) ? 0x80 : 00 );
+ m_dac->write(BIT(data, 11));
}
int hp48_state::hp48_get_in( )
diff --git a/src/mame/machine/inder_sb.cpp b/src/mame/machine/inder_sb.cpp
index bd5cbd170a1..daddc97e6f4 100644
--- a/src/mame/machine/inder_sb.cpp
+++ b/src/mame/machine/inder_sb.cpp
@@ -5,7 +5,7 @@
#include "emu.h"
#include "machine/inder_sb.h"
-
+#include "sound/volt_reg.h"
extern const device_type INDER_AUDIO = &device_creator<inder_sb_device>;
@@ -15,11 +15,7 @@ inder_sb_device::inder_sb_device(const machine_config &mconfig, const char *tag,
: device_t(mconfig, INDER_AUDIO, "Inder 4xDAC Sound Board", tag, owner, clock, "indersb", __FILE__),
device_mixer_interface(mconfig, *this, 2),
m_audiocpu(*this, "audiocpu"),
- m_ctc(*this, "ctc"),
- m_dac0(*this, "dac0" ),
- m_dac1(*this, "dac1" ),
- m_dac2(*this, "dac2" ),
- m_dac3(*this, "dac3" )
+ m_ctc(*this, "ctc")
{
}
@@ -153,54 +149,6 @@ WRITE8_MEMBER(inder_sb_device::megaphx_sound_to_68k_w)
m_soundback = data;
}
-WRITE8_MEMBER(inder_sb_device::dac0_value_write)
-{
-// printf("dac0_data_write %02x\n", data);
- m_dac0->write_unsigned8(data);
-}
-
-WRITE8_MEMBER(inder_sb_device::dac0_gain_write)
-{
-// printf("dac0_gain_write %02x\n", data);
- dac_gain[0] = data;
-}
-
-WRITE8_MEMBER(inder_sb_device::dac1_value_write)
-{
-// printf("dac1_data_write %02x\n", data);
- m_dac1->write_unsigned8(data);
-}
-
-WRITE8_MEMBER(inder_sb_device::dac1_gain_write)
-{
-// printf("dac1_gain_write %02x\n", data);
- dac_gain[1] = data;
-}
-
-WRITE8_MEMBER(inder_sb_device::dac2_value_write)
-{
-// printf("dac2_data_write %02x\n", data);
- m_dac2->write_unsigned8(data);
-}
-
-WRITE8_MEMBER(inder_sb_device::dac2_gain_write)
-{
-// printf("dac2_gain_write %02x\n", data);
- dac_gain[2] = data;
-}
-
-WRITE8_MEMBER(inder_sb_device::dac3_value_write)
-{
-// printf("dac3_data_write %02x\n", data);
- m_dac3->write_unsigned8(data);
-}
-
-WRITE8_MEMBER(inder_sb_device::dac3_gain_write)
-{
-// printf("dac3_gain_write %02x\n", data);
- dac_gain[3] = data;
-}
-
WRITE8_MEMBER(inder_sb_device::dac0_rombank_write)
{
m_soundbank[0] = data;
@@ -231,14 +179,14 @@ WRITE8_MEMBER(inder_sb_device::dac3_rombank_write)
static ADDRESS_MAP_START( sound_io, AS_IO, 8, inder_sb_device )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x00, 0x00) AM_WRITE(dac0_value_write)
- AM_RANGE(0x01, 0x01) AM_WRITE(dac0_gain_write)
- AM_RANGE(0x02, 0x02) AM_WRITE(dac1_value_write)
- AM_RANGE(0x03, 0x03) AM_WRITE(dac1_gain_write)
- AM_RANGE(0x04, 0x04) AM_WRITE(dac2_value_write)
- AM_RANGE(0x05, 0x05) AM_WRITE(dac2_gain_write)
- AM_RANGE(0x06, 0x06) AM_WRITE(dac3_value_write)
- AM_RANGE(0x07, 0x07) AM_WRITE(dac3_gain_write)
+ AM_RANGE(0x00, 0x00) AM_DEVWRITE("dac0", dac_byte_interface, write)
+ AM_RANGE(0x01, 0x01) AM_DEVWRITE("dac0vol", dac_byte_interface, write)
+ AM_RANGE(0x02, 0x02) AM_DEVWRITE("dac1", dac_byte_interface, write)
+ AM_RANGE(0x03, 0x03) AM_DEVWRITE("dac1vol", dac_byte_interface, write)
+ AM_RANGE(0x04, 0x04) AM_DEVWRITE("dac2", dac_byte_interface, write)
+ AM_RANGE(0x05, 0x05) AM_DEVWRITE("dac2vol", dac_byte_interface, write)
+ AM_RANGE(0x06, 0x06) AM_DEVWRITE("dac3", dac_byte_interface, write)
+ AM_RANGE(0x07, 0x07) AM_DEVWRITE("dac3vol", dac_byte_interface, write)
// not 100% sure how rom banking works.. but each channel can specify a different bank for the 0x8000 range. Maybe the bank happens when the interrupt triggers so each channel reads the correct data? (so we'd need to put the actual functions in the CTC callbacks)
AM_RANGE(0x10, 0x10) AM_WRITE(dac0_rombank_write)
@@ -271,15 +219,20 @@ static MACHINE_CONFIG_FRAGMENT( inder_sb )
MCFG_Z80CTC_ZC2_CB(WRITELINE(inder_sb_device, z80ctc_ch3))
// was this correct?!?
- MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_DAC_ADD("dac0")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
- MCFG_DAC_ADD("dac1")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
- MCFG_DAC_ADD("dac2")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
- MCFG_DAC_ADD("dac3")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac0", DAC_8BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) // unknown DAC
+ MCFG_SOUND_ADD("dac1", DAC_8BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) // unknown DAC
+ MCFG_SOUND_ADD("dac2", DAC_8BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) // unknown DAC
+ MCFG_SOUND_ADD("dac3", DAC_8BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) // unknown DAC
+ MCFG_SOUND_ADD("dac0vol", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE_EX(0, "dac0", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac0", -1.0, DAC_VREF_NEG_INPUT) // unknown DAC
+ MCFG_SOUND_ADD("dac1vol", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE_EX(0, "dac1", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac1", -1.0, DAC_VREF_NEG_INPUT) // unknown DAC
+ MCFG_SOUND_ADD("dac2vol", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE_EX(0, "dac2", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac2", -1.0, DAC_VREF_NEG_INPUT) // unknown DAC
+ MCFG_SOUND_ADD("dac3vol", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE_EX(0, "dac3", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac3", -1.0, DAC_VREF_NEG_INPUT) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac0vol", 1.0, DAC_VREF_POS_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac1vol", 1.0, DAC_VREF_POS_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac2vol", 1.0, DAC_VREF_POS_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "dac3vol", 1.0, DAC_VREF_POS_INPUT)
MACHINE_CONFIG_END
machine_config_constructor inder_sb_device::device_mconfig_additions() const
diff --git a/src/mame/machine/inder_sb.h b/src/mame/machine/inder_sb.h
index 83cf035c652..fab1b67ce30 100644
--- a/src/mame/machine/inder_sb.h
+++ b/src/mame/machine/inder_sb.h
@@ -29,25 +29,11 @@ public:
required_device<cpu_device> m_audiocpu;
required_device<z80ctc_device> m_ctc;
- required_device<dac_device> m_dac0;
- required_device<dac_device> m_dac1;
- required_device<dac_device> m_dac2;
- required_device<dac_device> m_dac3;
DECLARE_READ8_MEMBER(megaphx_sound_sent_r);
DECLARE_READ8_MEMBER(megaphx_sound_cmd_r);
DECLARE_WRITE8_MEMBER(megaphx_sound_to_68k_w);
-
- DECLARE_WRITE8_MEMBER(dac0_value_write);
- DECLARE_WRITE8_MEMBER(dac0_gain_write);
- DECLARE_WRITE8_MEMBER(dac1_value_write);
- DECLARE_WRITE8_MEMBER(dac1_gain_write);
- DECLARE_WRITE8_MEMBER(dac2_value_write);
- DECLARE_WRITE8_MEMBER(dac2_gain_write);
- DECLARE_WRITE8_MEMBER(dac3_value_write);
- DECLARE_WRITE8_MEMBER(dac3_gain_write);
-
DECLARE_WRITE8_MEMBER(dac0_rombank_write);
DECLARE_WRITE8_MEMBER(dac1_rombank_write);
DECLARE_WRITE8_MEMBER(dac2_rombank_write);
@@ -67,7 +53,6 @@ public:
DECLARE_READ16_MEMBER(megaphx_0x050002_r);
DECLARE_WRITE16_MEMBER(megaphx_0x050000_w);
- UINT8 dac_gain[4];
UINT8 m_soundbank[4];
int m_soundsent;
diff --git a/src/mame/machine/leland.cpp b/src/mame/machine/leland.cpp
index 95d43339ecb..ba0ce34ec38 100644
--- a/src/mame/machine/leland.cpp
+++ b/src/mame/machine/leland.cpp
@@ -13,7 +13,6 @@
#include "machine/eepromser.h"
#include "cpu/z80/z80.h"
#include "includes/leland.h"
-#include "sound/ay8910.h"
/*************************************
@@ -1093,7 +1092,11 @@ READ8_MEMBER(leland_state::leland_master_input_r)
case 0x03: /* /IGID */
case 0x13:
- result = machine().device<ay8910_device>("ay8910.1")->data_r(space, offset);
+ if (m_ay8910)
+ result &= m_ay8910->data_r(space, 0);
+
+ if (m_ay8912)
+ result &= m_ay8912->data_r(space, 0);
break;
case 0x10: /* /GIN0 */
@@ -1132,7 +1135,11 @@ WRITE8_MEMBER(leland_state::leland_master_output_w)
case 0x0a: /* /OGIA */
case 0x0b: /* /OGID */
- machine().device<ay8910_device>("ay8910.1")->address_data_w(space, offset, data);
+ if (m_ay8910)
+ m_ay8910->address_data_w(space, offset - 0x0a, data);
+
+ if (m_ay8912)
+ m_ay8912->address_data_w(space, offset - 0x0a, data);
break;
case 0x0c: /* /BKXL */
diff --git a/src/mame/machine/mac.cpp b/src/mame/machine/mac.cpp
index ea4bf0d2eb4..97ee0339c42 100644
--- a/src/mame/machine/mac.cpp
+++ b/src/mame/machine/mac.cpp
@@ -1440,6 +1440,7 @@ WRITE8_MEMBER(mac_state::mac_via_out_a)
if (m_model < MODEL_MAC_II)
{
m_snd_vol = data & 0x07;
+ update_volume();
}
/* Early Mac models had VIA A4 control overlaying. In the Mac SE (and
@@ -1468,7 +1469,8 @@ WRITE8_MEMBER(mac_state::mac_via_out_b)
if (AUDIO_IS_CLASSIC)
{
- m_snd_enable = ((data & 0x80) == 0) ? true : false;
+ m_snd_enable = (data & 0x80) == 0;
+ update_volume();
}
m_rtc->ce_w((data & 0x04)>>2);
@@ -1476,6 +1478,26 @@ WRITE8_MEMBER(mac_state::mac_via_out_b)
m_rtc->clk_w((data >> 1) & 0x01);
}
+void mac_state::update_volume(void)
+{
+ if (AUDIO_IS_CLASSIC)
+ {
+ if (!m_snd_enable)
+ {
+ // ls161 clear input
+ m_dac->set_output_gain(ALL_OUTPUTS, 0);
+ }
+ else
+ {
+ // sound -> r13 (470k)
+ // sound -> r12 (470k) -> 4016 (pa0 != 0)
+ // sound -> r17 (150k) -> 4016 (pa1 != 0)
+ // sound -> r16 (68k) -> 4016 (pa2 != 0)
+ m_dac->set_output_gain(ALL_OUTPUTS, 8.0 / (m_snd_vol + 1));
+ }
+ }
+}
+
WRITE8_MEMBER(mac_state::mac_via_out_b_bbadb)
{
// printf("VIA1 OUT B: %02x (PC %x)\n", data, m_maincpu->safe_pc());
@@ -1989,10 +2011,6 @@ void mac_state::machine_reset()
m_pm_data_send = m_pm_data_recv = m_pm_ack = m_pm_req = m_pm_dptr = 0;
m_pm_state = 0;
m_last_taken_interrupt = 0;
-
- m_snd_enable = false;
- m_main_buffer = true;
- m_snd_vol = 3;
}
WRITE_LINE_MEMBER(mac_state::cuda_reset_w)
diff --git a/src/mame/machine/mega32x.cpp b/src/mame/machine/mega32x.cpp
index 0e7dfecccd9..3cab44e8d1b 100644
--- a/src/mame/machine/mega32x.cpp
+++ b/src/mame/machine/mega32x.cpp
@@ -199,6 +199,7 @@ GFX check (these don't explicitly fails):
*/
#include "emu.h"
#include "machine/mega32x.h"
+#include "sound/volt_reg.h"
const device_type SEGA_32X_NTSC = &device_creator<sega_32x_ntsc_device>;
@@ -208,8 +209,8 @@ sega_32x_device::sega_32x_device(const machine_config &mconfig, device_type type
: device_t(mconfig, type, name, tag, owner, clock, shortname, source)
, m_master_cpu(*this, "32x_master_sh2")
, m_slave_cpu(*this, "32x_slave_sh2")
- , m_lch_pwm(*this, "lch_pwm")
- , m_rch_pwm(*this, "rch_pwm")
+ , m_ldac(*this, "ldac")
+ , m_rdac(*this, "rdac")
, m_sh2_shared(*this, "sh2_shared")
, m_palette(*this, finder_base::DUMMY_TAG)
{
@@ -821,8 +822,8 @@ TIMER_CALLBACK_MEMBER(sega_32x_device::handle_pwm_callback)
switch(m_pwm_ctrl & 3)
{
case 0: m_lch_index_r++; /*Speaker OFF*/ break;
- case 1: m_lch_pwm->write_signed16(m_cur_lch[m_lch_index_r++]); break;
- case 2: m_rch_pwm->write_signed16(m_cur_lch[m_lch_index_r++]); break;
+ case 1: m_ldac->write(m_cur_lch[m_lch_index_r++]); break;
+ case 2: m_rdac->write(m_cur_lch[m_lch_index_r++]); break;
case 3: popmessage("Undefined PWM Lch value 3, contact MESSdev"); break;
}
@@ -836,8 +837,8 @@ TIMER_CALLBACK_MEMBER(sega_32x_device::handle_pwm_callback)
switch((m_pwm_ctrl & 0xc) >> 2)
{
case 0: m_rch_index_r++; /*Speaker OFF*/ break;
- case 1: m_rch_pwm->write_signed16(m_cur_rch[m_rch_index_r++]); break;
- case 2: m_lch_pwm->write_signed16(m_cur_rch[m_rch_index_r++]); break;
+ case 1: m_rdac->write(m_cur_rch[m_rch_index_r++]); break;
+ case 2: m_ldac->write(m_cur_rch[m_rch_index_r++]); break;
case 3: popmessage("Undefined PWM Rch value 3, contact MESSdev"); break;
}
@@ -1769,11 +1770,11 @@ static MACHINE_CONFIG_FRAGMENT( _32x_ntsc )
MCFG_SH2_FIFO_DATA_AVAIL_CB(sega_32x_device, _32x_fifo_available_callback)
#endif
- MCFG_DAC_ADD("lch_pwm")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, ":lspeaker", 0.40)
-
- MCFG_DAC_ADD("rch_pwm")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, ":rspeaker", 0.40)
+ MCFG_SOUND_ADD("ldac", DAC_16BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, ":lspeaker", 0.4) // unknown DAC
+ MCFG_SOUND_ADD("rdac", DAC_16BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, ":rspeaker", 0.4) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "ldac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "ldac", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "rdac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "rdac", -1.0, DAC_VREF_NEG_INPUT)
_32X_INTERLEAVE_LEVEL
MACHINE_CONFIG_END
@@ -1799,11 +1800,11 @@ static MACHINE_CONFIG_FRAGMENT( _32x_pal )
MCFG_SH2_FIFO_DATA_AVAIL_CB(sega_32x_device, _32x_fifo_available_callback)
#endif
- MCFG_DAC_ADD("lch_pwm")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, ":lspeaker", 0.40)
-
- MCFG_DAC_ADD("rch_pwm")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, ":rspeaker", 0.40)
+ MCFG_SOUND_ADD("ldac", DAC_16BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, ":lspeaker", 0.4) // unknown DAC
+ MCFG_SOUND_ADD("rdac", DAC_16BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, ":rspeaker", 0.4) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "ldac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "ldac", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "rdac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "rdac", -1.0, DAC_VREF_NEG_INPUT)
_32X_INTERLEAVE_LEVEL
MACHINE_CONFIG_END
diff --git a/src/mame/machine/mega32x.h b/src/mame/machine/mega32x.h
index 80940755726..92e51c20187 100644
--- a/src/mame/machine/mega32x.h
+++ b/src/mame/machine/mega32x.h
@@ -35,8 +35,8 @@ public:
required_device<sh2_device> m_master_cpu;
required_device<sh2_device> m_slave_cpu;
- required_device<dac_device> m_lch_pwm;
- required_device<dac_device> m_rch_pwm;
+ required_device<dac_word_interface> m_ldac;
+ required_device<dac_word_interface> m_rdac;
required_shared_ptr<UINT32> m_sh2_shared;
diff --git a/src/mame/machine/mikro80.cpp b/src/mame/machine/mikro80.cpp
index 30eea2124bf..0d0b6d927ff 100644
--- a/src/mame/machine/mikro80.cpp
+++ b/src/mame/machine/mikro80.cpp
@@ -103,3 +103,8 @@ READ8_MEMBER(mikro80_state::mikro80_tape_r)
}
return 0xff;
}
+
+WRITE8_MEMBER(mikro80_state::radio99_sound_w)
+{
+ m_dac->write(BIT(data, 1));
+}
diff --git a/src/mame/machine/msx.cpp b/src/mame/machine/msx.cpp
index 0936a2b94f4..f55a90394f3 100644
--- a/src/mame/machine/msx.cpp
+++ b/src/mame/machine/msx.cpp
@@ -344,7 +344,7 @@ WRITE8_MEMBER( msx_state::msx_ppi_port_c_w )
/* key click */
if ( BIT(m_port_c_old ^ data, 7) )
- m_dac->write_signed8(BIT(data, 7) ? 0x7f : 0);
+ m_dac->write(BIT(data, 7));
/* cassette motor on/off */
if ( BIT(m_port_c_old ^ data, 4) )
diff --git a/src/mame/machine/namcos1.cpp b/src/mame/machine/namcos1.cpp
index 9d7fa409421..2e35f03beae 100644
--- a/src/mame/machine/namcos1.cpp
+++ b/src/mame/machine/namcos1.cpp
@@ -513,10 +513,6 @@ void namcos1_state::machine_start()
m_soundbank->configure_entries(0, 8, memregion("audiocpu")->base(), 0x4000);
m_mcubank->configure_entries(0, 24, memregion("voice")->base(), 0x8000);
- save_item(NAME(m_dac0_value));
- save_item(NAME(m_dac1_value));
- save_item(NAME(m_dac0_gain));
- save_item(NAME(m_dac1_gain));
save_item(NAME(m_key));
save_item(NAME(m_mcu_patch_data));
save_item(NAME(m_reset));
@@ -527,7 +523,6 @@ void namcos1_state::machine_reset()
/* mcu patch data clear */
m_mcu_patch_data = 0;
- init_DACs();
memset(m_key, 0, sizeof(m_key));
m_key_quotient = 0;
m_key_reminder = 0;
diff --git a/src/mame/machine/orao.cpp b/src/mame/machine/orao.cpp
index 5540d9092fb..db7c097103f 100644
--- a/src/mame/machine/orao.cpp
+++ b/src/mame/machine/orao.cpp
@@ -10,7 +10,6 @@
****************************************************************************/
#include "emu.h"
-#include "sound/dac.h"
#include "imagedev/cassette.h"
#include "includes/orao.h"
diff --git a/src/mame/machine/pc9801_86.cpp b/src/mame/machine/pc9801_86.cpp
index b0580a67c70..3a354dcdb92 100644
--- a/src/mame/machine/pc9801_86.cpp
+++ b/src/mame/machine/pc9801_86.cpp
@@ -17,6 +17,7 @@
#include "emu.h"
#include "machine/pc9801_86.h"
+#include "sound/volt_reg.h"
#define MAIN_CLOCK_X1 XTAL_1_9968MHz
#define QUEUE_SIZE 32768
@@ -56,10 +57,11 @@ static MACHINE_CONFIG_FRAGMENT( pc9801_86_config )
MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(pc9801_86_device, opn_portb_w))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.00)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.00)
- MCFG_SOUND_ADD("dacl", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.00)
- MCFG_SOUND_ADD("dacr", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.00)
+ MCFG_SOUND_ADD("ldac", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) // unknown DAC
+ MCFG_SOUND_ADD("rdac", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) // unknown DAC
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "ldac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "ldac", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE_EX(0, "rdac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "rdac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
//-------------------------------------------------
@@ -128,8 +130,8 @@ ioport_constructor pc9801_86_device::device_input_ports() const
pc9801_86_device::pc9801_86_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, PC9801_86, "pc9801_86", tag, owner, clock, "pc9801_86", __FILE__),
m_opna(*this, "opna"),
- m_dacl(*this, "dacl"),
- m_dacr(*this, "dacr"),
+ m_ldac(*this, "ldac"),
+ m_rdac(*this, "rdac"),
m_queue(QUEUE_SIZE)
{
}
@@ -323,32 +325,32 @@ void pc9801_86_device::device_timer(emu_timer& timer, device_timer_id id, int pa
switch(m_pcm_mode & 0x70)
{
case 0x70: // 8bit stereo
- m_dacl->write(queue_pop() << 8);
- m_dacr->write(queue_pop() << 8);
+ m_ldac->write(queue_pop() << 8);
+ m_rdac->write(queue_pop() << 8);
break;
case 0x60: // 8bit left only
- m_dacl->write(queue_pop() << 8);
+ m_ldac->write(queue_pop() << 8);
break;
case 0x50: // 8bit right only
- m_dacr->write(queue_pop() << 8);
+ m_rdac->write(queue_pop() << 8);
break;
case 0x30: // 16bit stereo
lsample = queue_pop();
lsample |= queue_pop() << 8;
rsample = queue_pop();
rsample |= queue_pop() << 8;
- m_dacl->write(lsample);
- m_dacr->write(rsample);
+ m_ldac->write(lsample);
+ m_rdac->write(rsample);
break;
case 0x20: // 16bit left only
lsample = queue_pop();
lsample |= queue_pop() << 8;
- m_dacl->write(lsample);
+ m_ldac->write(lsample);
break;
case 0x10: // 16bit right only
rsample = queue_pop();
rsample |= queue_pop() << 8;
- m_dacr->write(rsample);
+ m_rdac->write(rsample);
break;
}
if((queue_count() < m_irq_rate) && (m_pcm_ctrl & 0x20))
diff --git a/src/mame/machine/pc9801_86.h b/src/mame/machine/pc9801_86.h
index 9597760b85e..52dd2eb7227 100644
--- a/src/mame/machine/pc9801_86.h
+++ b/src/mame/machine/pc9801_86.h
@@ -58,8 +58,8 @@ private:
UINT16 m_head, m_tail, m_count, m_irq_rate;
bool m_pcmirq, m_fmirq;
required_device<ym2608_device> m_opna;
- required_device<dac_device> m_dacl;
- required_device<dac_device> m_dacr;
+ required_device<dac_word_interface> m_ldac;
+ required_device<dac_word_interface> m_rdac;
dynamic_buffer m_queue;
emu_timer *m_dac_timer;
};
diff --git a/src/mame/machine/special.cpp b/src/mame/machine/special.cpp
index e85bb7d4240..23db4ddcd67 100644
--- a/src/mame/machine/special.cpp
+++ b/src/mame/machine/special.cpp
@@ -121,7 +121,7 @@ WRITE8_MEMBER( special_state::specialist_8255_portc_w )
m_cassette->output(BIT(data, 7) ? 1 : -1);
- m_dac->write_unsigned8(BIT(data, 5)); //beeper
+ m_dac->write(BIT(data, 5)); //beeper
}
void special_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
diff --git a/src/mame/machine/thomson.cpp b/src/mame/machine/thomson.cpp
index 938b3952c13..1dae4a1b972 100644
--- a/src/mame/machine/thomson.cpp
+++ b/src/mame/machine/thomson.cpp
@@ -120,9 +120,9 @@ int thomson_state::to7_get_cassette()
/* 1-bit cassette output */
-void thomson_state::to7_set_cassette( int data )
+WRITE_LINE_MEMBER(thomson_state::to7_set_cassette)
{
- m_cassette->output(data ? 1. : -1. );
+ m_cassette->output(state ? 1. : -1. );
}
@@ -487,13 +487,6 @@ WRITE8_MEMBER( thomson_state::to7_timer_port_out )
-WRITE8_MEMBER( thomson_state::to7_timer_cp2_out )
-{
- m_buzzer->write_unsigned8(data ? 0x80 : 0); /* 1-bit buzzer */
-}
-
-
-
READ8_MEMBER( thomson_state::to7_timer_port_in )
{
int lightpen = (m_io_lightpen_button->read() & 1) ? 2 : 0;
@@ -503,13 +496,6 @@ READ8_MEMBER( thomson_state::to7_timer_port_in )
-WRITE8_MEMBER( thomson_state::to7_timer_tco_out )
-{
- /* 1-bit cassette output */
- to7_set_cassette( data );
-}
-
-
/* ------------ lightpen automaton ------------ */
@@ -863,7 +849,7 @@ UINT8 thomson_state::to7_get_mouse_signal()
void thomson_state::to7_game_sound_update()
{
- m_dac->write_unsigned8(m_to7_game_mute ? 0 : (m_to7_game_sound << 2) );
+ m_dac->write(m_to7_game_mute ? 0 : m_to7_game_sound );
}
@@ -1426,13 +1412,6 @@ READ8_MEMBER( thomson_state::mo5_sys_porta_in )
-WRITE8_MEMBER( thomson_state::mo5_sys_portb_out )
-{
- m_buzzer->write_unsigned8((data & 1) ? 0x80 : 0); /* 1-bit buzzer */
-}
-
-
-
READ8_MEMBER( thomson_state::mo5_sys_portb_in )
{
UINT8 portb = m_pia_sys->b_output();
@@ -3587,10 +3566,10 @@ WRITE8_MEMBER( thomson_state::to8_timer_port_out )
-WRITE8_MEMBER( thomson_state::to8_timer_cp2_out )
+WRITE_LINE_MEMBER( thomson_state::to8_timer_cp2_out )
{
/* mute */
- m_to7_game_mute = data;
+ m_to7_game_mute = state;
to7_game_sound_update();
}
@@ -4273,13 +4252,6 @@ WRITE8_MEMBER( thomson_state::mo6_sys_porta_out )
-WRITE8_MEMBER( thomson_state::mo6_sys_portb_out )
-{
- m_buzzer->write_unsigned8((data & 1) ? 0x80 : 0); /* bit 0: buzzer */
-}
-
-
-
WRITE_LINE_MEMBER( thomson_state::mo6_sys_cb2_out )
{
/* SCART pin 8 = slow switch (?) */
diff --git a/src/mame/machine/ut88.cpp b/src/mame/machine/ut88.cpp
index 43d76bbd904..ee30eced952 100644
--- a/src/mame/machine/ut88.cpp
+++ b/src/mame/machine/ut88.cpp
@@ -11,7 +11,6 @@
#include "emu.h"
#include "cpu/i8085/i8085.h"
-#include "sound/dac.h"
#include "imagedev/cassette.h"
#include "machine/i8255.h"
#include "includes/ut88.h"
@@ -109,7 +108,7 @@ WRITE8_MEMBER( ut88_state::ut88_keyboard_w )
WRITE8_MEMBER( ut88_state::ut88_sound_w )
{
- m_dac->write_unsigned8(data); //beeper
+ m_dac->write(BIT(data, 0));
m_cassette->output(BIT(data, 0) ? 1 : -1);
}
diff --git a/src/mame/video/cheekyms.cpp b/src/mame/video/cheekyms.cpp
index a042a8cbe14..7b1f960b4ff 100644
--- a/src/mame/video/cheekyms.cpp
+++ b/src/mame/video/cheekyms.cpp
@@ -9,7 +9,6 @@ Functions to emulate the video hardware of the machine.
***************************************************************************/
#include "emu.h"
-#include "sound/dac.h"
#include "includes/cheekyms.h"
/* bit 3 and 7 of the char color PROMs are used for something -- not currently emulated -
@@ -39,11 +38,16 @@ PALETTE_INIT_MEMBER(cheekyms_state, cheekyms)
}
}
-
WRITE8_MEMBER(cheekyms_state::port_40_w)
{
- /* the lower bits probably trigger sound samples */
- m_dac->write_unsigned8(data ? 0x80 : 0);
+ m_dac0->write(BIT(data, 7)); // tune
+ m_dac1->write(BIT(data, 6)); // mouse eating cheese
+ m_dac2->write(BIT(data, 5)); // hammer
+ m_dac3->write(BIT(data, 4)); // mouse died
+ m_dac4->write(BIT(data, 3)); // mystery died
+ m_dac5->write(BIT(data, 2)); // mouse appears
+ m_dac6->write(BIT(data, 1)); // mystery appears
+ m_dac7->write(BIT(data, 0));
}
diff --git a/src/mame/video/exterm.cpp b/src/mame/video/exterm.cpp
index a22cc152b77..a80abd0747f 100644
--- a/src/mame/video/exterm.cpp
+++ b/src/mame/video/exterm.cpp
@@ -7,7 +7,6 @@
***************************************************************************/
#include "emu.h"
-#include "cpu/tms34010/tms34010.h"
#include "includes/exterm.h"
diff --git a/src/mame/video/leland.cpp b/src/mame/video/leland.cpp
index 928a1e9ab78..8d0d64df9cd 100644
--- a/src/mame/video/leland.cpp
+++ b/src/mame/video/leland.cpp
@@ -35,10 +35,10 @@ TIMER_CALLBACK_MEMBER(leland_state::scanline_callback)
/* update the DACs */
if (!(m_dac_control & 0x01))
- m_dac0->write_unsigned8(m_video_ram[(m_last_scanline) * 256 + 160]);
+ m_dac0->write(m_video_ram[(m_last_scanline) * 256 + 160]);
if (!(m_dac_control & 0x02))
- m_dac1->write_unsigned8(m_video_ram[(m_last_scanline) * 256 + 161]);
+ m_dac1->write(m_video_ram[(m_last_scanline) * 256 + 161]);
m_last_scanline = scanline;
diff --git a/src/mame/video/vectrex.cpp b/src/mame/video/vectrex.cpp
index b78c096e343..092f22c5ffe 100644
--- a/src/mame/video/vectrex.cpp
+++ b/src/mame/video/vectrex.cpp
@@ -265,7 +265,7 @@ void vectrex_state::vectrex_multiplexer(int mux)
timer_set(attotime::from_nsec(ANALOG_DELAY), TIMER_UPDATE_SIGNAL, m_via_out[PORTA], &m_analog[mux]);
if (mux == A_AUDIO)
- m_dac->write_unsigned8(m_via_out[PORTA]);
+ m_dac->write(m_via_out[PORTA] ^ 0x80); // not gate shown on schematic
}