summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2013-04-12 09:26:32 +0000
committer Miodrag Milanovic <mmicko@gmail.com>2013-04-12 09:26:32 +0000
commit1d40fe6824a3a57df60daaefa3b84feb9986d7a9 (patch)
treeaa279a2c0badf53cf71094190fd98f820bec2d4f /src
parent2938d4c348f4891590af3ce11f707947b83ad05d (diff)
dac_device tag lookup cleanup (nw)
Diffstat (limited to 'src')
-rw-r--r--src/mame/audio/cchasm.c4
-rw-r--r--src/mame/audio/harddriv.c2
-rw-r--r--src/mame/audio/n8080.c4
-rw-r--r--src/mame/drivers/amaticmg.c2
-rw-r--r--src/mame/drivers/aristmk5.c2
-rw-r--r--src/mame/drivers/calchase.c12
-rw-r--r--src/mame/drivers/champbas.c9
-rw-r--r--src/mame/drivers/cheekyms.c1
-rw-r--r--src/mame/drivers/circusc.c2
-rw-r--r--src/mame/drivers/coolpool.c3
-rw-r--r--src/mame/drivers/cosmic.c4
-rw-r--r--src/mame/drivers/csplayh5.c10
-rw-r--r--src/mame/drivers/cvs.c4
-rw-r--r--src/mame/drivers/equites.c2
-rw-r--r--src/mame/drivers/ertictac.c2
-rw-r--r--src/mame/drivers/esripsys.c3
-rw-r--r--src/mame/drivers/exterm.c3
-rw-r--r--src/mame/drivers/galaxian.c5
-rw-r--r--src/mame/drivers/gei.c8
-rw-r--r--src/mame/drivers/homedata.c1
-rw-r--r--src/mame/drivers/looping.c7
-rw-r--r--src/mame/drivers/m72.c5
-rw-r--r--src/mame/drivers/magicfly.c6
-rw-r--r--src/mame/drivers/mappy.c3
-rw-r--r--src/mame/drivers/meyc8080.c16
-rw-r--r--src/mame/drivers/meyc8088.c6
-rw-r--r--src/mame/drivers/mjsister.c2
-rw-r--r--src/mame/drivers/mogura.c2
-rw-r--r--src/mame/drivers/mpoker.c2
-rw-r--r--src/mame/drivers/murogem.c6
-rw-r--r--src/mame/drivers/nbmj9195.c8
-rw-r--r--src/mame/drivers/niyanpai.c4
-rw-r--r--src/mame/drivers/ppmast93.c6
-rw-r--r--src/mame/drivers/quizshow.c6
-rw-r--r--src/mame/drivers/rltennis.c2
-rw-r--r--src/mame/drivers/sbrkout.c6
-rw-r--r--src/mame/drivers/segas24.c4
-rw-r--r--src/mame/drivers/suna16.c12
-rw-r--r--src/mame/drivers/taitosj.c6
-rw-r--r--src/mame/drivers/tceptor.c3
-rw-r--r--src/mame/drivers/tnzs.c3
-rw-r--r--src/mame/drivers/truco.c2
-rw-r--r--src/mame/drivers/trucocl.c3
-rw-r--r--src/mame/drivers/unkhorse.c6
-rw-r--r--src/mame/drivers/vcombat.c7
-rw-r--r--src/mame/drivers/videopkr.c7
-rw-r--r--src/mame/drivers/zaccaria.c3
-rw-r--r--src/mame/includes/cchasm.h7
-rw-r--r--src/mame/includes/champbas.h10
-rw-r--r--src/mame/includes/cheekyms.h5
-rw-r--r--src/mame/includes/circusc.h3
-rw-r--r--src/mame/includes/coolpool.h5
-rw-r--r--src/mame/includes/cosmic.h3
-rw-r--r--src/mame/includes/cvs.h7
-rw-r--r--src/mame/includes/equites.h6
-rw-r--r--src/mame/includes/esripsys.h5
-rw-r--r--src/mame/includes/exterm.h5
-rw-r--r--src/mame/includes/galaxian.h5
-rw-r--r--src/mame/includes/harddriv.h4
-rw-r--r--src/mame/includes/homedata.h5
-rw-r--r--src/mame/includes/m72.h5
-rw-r--r--src/mame/includes/mappy.h8
-rw-r--r--src/mame/includes/n8080.h5
-rw-r--r--src/mame/includes/nbmj9195.h8
-rw-r--r--src/mame/includes/niyanpai.h7
-rw-r--r--src/mame/includes/rltennis.h8
-rw-r--r--src/mame/includes/segas24.h5
-rw-r--r--src/mame/includes/suna16.h13
-rw-r--r--src/mame/includes/taitosj.h6
-rw-r--r--src/mame/includes/tatsumi.h2
-rw-r--r--src/mame/includes/tceptor.h5
-rw-r--r--src/mame/includes/tnzs.h5
-rw-r--r--src/mame/includes/truco.h6
-rw-r--r--src/mame/includes/trucocl.h6
-rw-r--r--src/mame/includes/zaccaria.h6
-rw-r--r--src/mess/drivers/a310.c2
-rw-r--r--src/mess/drivers/craft.c2
-rw-r--r--src/mess/drivers/dectalk.c9
-rw-r--r--src/mess/drivers/pockstat.c6
-rw-r--r--src/mess/includes/hp48.h6
-rw-r--r--src/mess/includes/orao.h6
-rw-r--r--src/mess/machine/hp48.c2
-rw-r--r--src/mess/machine/orao.c3
83 files changed, 255 insertions, 172 deletions
diff --git a/src/mame/audio/cchasm.c b/src/mame/audio/cchasm.c
index 1c4fe5dbc9f..219233f3f67 100644
--- a/src/mame/audio/cchasm.c
+++ b/src/mame/audio/cchasm.c
@@ -102,7 +102,7 @@ WRITE_LINE_MEMBER(cchasm_state::ctc_timer_1_w)
{
m_output[0] ^= 0x7f;
m_channel_active[0] = 1;
- machine().device<dac_device>("dac1")->write_unsigned8(m_output[0]);
+ m_dac1->write_unsigned8(m_output[0]);
}
}
@@ -112,7 +112,7 @@ WRITE_LINE_MEMBER(cchasm_state::ctc_timer_2_w)
{
m_output[1] ^= 0x7f;
m_channel_active[1] = 1;
- machine().device<dac_device>("dac2")->write_unsigned8(m_output[0]);
+ m_dac2->write_unsigned8(m_output[0]);
}
}
diff --git a/src/mame/audio/harddriv.c b/src/mame/audio/harddriv.c
index 0fc7da872d0..24fe831e704 100644
--- a/src/mame/audio/harddriv.c
+++ b/src/mame/audio/harddriv.c
@@ -294,7 +294,7 @@ WRITE16_MEMBER(harddriv_state::hdsnddsp_dac_w)
{
/* DAC L */
if (!m_dacmute)
- downcast<dac_device *>(machine().device("dac"))->write_signed16(data ^ 0x8000);
+ m_dac->write_signed16(data ^ 0x8000);
}
diff --git a/src/mame/audio/n8080.c b/src/mame/audio/n8080.c
index 6efdbc9ae9c..2f69fbae73d 100644
--- a/src/mame/audio/n8080.c
+++ b/src/mame/audio/n8080.c
@@ -396,13 +396,13 @@ READ8_MEMBER(n8080_state::helifire_8035_p2_r)
WRITE8_MEMBER(n8080_state::n8080_dac_w)
{
- machine().device<dac_device>("dac")->write_unsigned8(data & 0x80);
+ m_dac->write_unsigned8(data & 0x80);
}
WRITE8_MEMBER(n8080_state::helifire_dac_w)
{
- machine().device<dac_device>("dac")->write_unsigned8(data * m_helifire_dac_volume);
+ m_dac->write_unsigned8(data * m_helifire_dac_volume);
}
diff --git a/src/mame/drivers/amaticmg.c b/src/mame/drivers/amaticmg.c
index 0044773c537..c616de2ded0 100644
--- a/src/mame/drivers/amaticmg.c
+++ b/src/mame/drivers/amaticmg.c
@@ -621,7 +621,7 @@ WRITE8_MEMBER(amaticmg_state::out_c_w)
WRITE8_MEMBER( amaticmg_state::unk80_w )
{
-// machine().device<dac_device>("dac")->write_unsigned8(data & 0x01); /* Sound DAC */
+// m_dac->write_unsigned8(data & 0x01); /* Sound DAC */
}
diff --git a/src/mame/drivers/aristmk5.c b/src/mame/drivers/aristmk5.c
index 1f6265590d5..0928c663431 100644
--- a/src/mame/drivers/aristmk5.c
+++ b/src/mame/drivers/aristmk5.c
@@ -376,7 +376,7 @@ void aristmk5_state::machine_start()
archimedes_init();
// reset the DAC to centerline
- //machine().device<dac_device>("dac")->write_signed8(0x80);
+ //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));
diff --git a/src/mame/drivers/calchase.c b/src/mame/drivers/calchase.c
index f44058c59da..53132a4a950 100644
--- a/src/mame/drivers/calchase.c
+++ b/src/mame/drivers/calchase.c
@@ -131,7 +131,9 @@ class calchase_state : public driver_device
public:
calchase_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
- m_maincpu(*this, "maincpu")
+ m_maincpu(*this, "maincpu"),
+ m_dac_l(*this, "dac_l"),
+ m_dac_r(*this, "dac_r")
{ }
UINT32 *m_bios_ram;
@@ -183,6 +185,8 @@ public:
virtual void machine_reset();
IRQ_CALLBACK_MEMBER(irq_callback);
void intel82439tx_init();
+ required_device<dac_device> m_dac_l;
+ required_device<dac_device> m_dac_r;
};
@@ -531,14 +535,12 @@ READ16_MEMBER(calchase_state::calchase_iocard5_r)
WRITE16_MEMBER(calchase_state::calchase_dac_l_w)
{
- dac_device *device = machine().device<dac_device>("dac_l");
- device->write_unsigned16((data & 0xfff) << 4);
+ m_dac_l->write_unsigned16((data & 0xfff) << 4);
}
WRITE16_MEMBER(calchase_state::calchase_dac_r_w)
{
- dac_device *device = machine().device<dac_device>("dac_r");
- device->write_unsigned16((data & 0xfff) << 4);
+ m_dac_r->write_unsigned16((data & 0xfff) << 4);
}
static ADDRESS_MAP_START( calchase_map, AS_PROGRAM, 32, calchase_state )
diff --git a/src/mame/drivers/champbas.c b/src/mame/drivers/champbas.c
index ffe7c3623c3..3186cbb0068 100644
--- a/src/mame/drivers/champbas.c
+++ b/src/mame/drivers/champbas.c
@@ -141,20 +141,17 @@ TIMER_CALLBACK_MEMBER(champbas_state::exctsccr_fm_callback)
// Champion Baseball has only one DAC
WRITE8_MEMBER(champbas_state::champbas_dac_w)
{
- dac_device *device = machine().device<dac_device>("dac");
- device->write_signed8(data << 2);
+ m_dac->write_signed8(data << 2);
}
WRITE8_MEMBER(champbas_state::champbas_dac1_w)
{
- dac_device *device = machine().device<dac_device>("dac1");
- device->write_signed8(data << 2);
+ m_dac1->write_signed8(data << 2);
}
WRITE8_MEMBER(champbas_state::champbas_dac2_w)
{
- dac_device *device = machine().device<dac_device>("dac2");
- device->write_signed8(data << 2);
+ m_dac2->write_signed8(data << 2);
}
/*************************************
diff --git a/src/mame/drivers/cheekyms.c b/src/mame/drivers/cheekyms.c
index 0a8f5786b13..48802238c75 100644
--- a/src/mame/drivers/cheekyms.c
+++ b/src/mame/drivers/cheekyms.c
@@ -109,7 +109,6 @@ GFXDECODE_END
void cheekyms_state::machine_start()
{
- m_dac = machine().device<dac_device>("dac");
}
INTERRUPT_GEN_MEMBER(cheekyms_state::vblank_irq)
diff --git a/src/mame/drivers/circusc.c b/src/mame/drivers/circusc.c
index af68034a612..1cbc22c9458 100644
--- a/src/mame/drivers/circusc.c
+++ b/src/mame/drivers/circusc.c
@@ -58,8 +58,6 @@ To enter service mode, keep 1&2 pressed on reset
void circusc_state::machine_start()
{
- m_dac = machine().device<dac_device>("dac");
-
save_item(NAME(m_sn_latch));
}
diff --git a/src/mame/drivers/coolpool.c b/src/mame/drivers/coolpool.c
index a11a577eeaa..efb40aecf56 100644
--- a/src/mame/drivers/coolpool.c
+++ b/src/mame/drivers/coolpool.c
@@ -539,8 +539,7 @@ WRITE16_MEMBER(coolpool_state::dsp_romaddr_w)
WRITE16_MEMBER(coolpool_state::dsp_dac_w)
{
- dac_device *device = machine().device<dac_device>("dac");
- device->write_signed16((INT16)(data << 4) + 0x8000);
+ m_dac->write_signed16((INT16)(data << 4) + 0x8000);
}
diff --git a/src/mame/drivers/cosmic.c b/src/mame/drivers/cosmic.c
index 8ca7561e342..14f71096881 100644
--- a/src/mame/drivers/cosmic.c
+++ b/src/mame/drivers/cosmic.c
@@ -958,7 +958,6 @@ static const samples_interface cosmicg_samples_interface =
MACHINE_START_MEMBER(cosmic_state,cosmic)
{
m_samples = machine().device<samples_device>("samples");
- m_dac = machine().device<dac_device>("dac");
save_item(NAME(m_sound_enabled));
save_item(NAME(m_march_select));
@@ -1539,11 +1538,10 @@ DRIVER_INIT_MEMBER(cosmic_state,devzone)
DRIVER_INIT_MEMBER(cosmic_state,nomnlnd)
{
- dac_device *dac = machine().device<dac_device>("dac");
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));
+ m_maincpu->space(AS_PROGRAM).install_write_handler(0x480a, 0x480a, write8_delegate(FUNC(dac_device::write_unsigned8),(dac_device*)m_dac));
}
DRIVER_INIT_MEMBER(cosmic_state,panic)
diff --git a/src/mame/drivers/csplayh5.c b/src/mame/drivers/csplayh5.c
index 81ae11da47a..56f1ac6ebf3 100644
--- a/src/mame/drivers/csplayh5.c
+++ b/src/mame/drivers/csplayh5.c
@@ -32,7 +32,9 @@ public:
csplayh5_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this,"maincpu"),
- m_v9958(*this,"v9958")
+ m_v9958(*this,"v9958"),
+ m_dac1(*this, "dac1"),
+ m_dac2(*this, "dac2")
{ }
UINT16 m_mux_data;
@@ -82,6 +84,8 @@ public:
virtual void machine_reset();
TIMER_DEVICE_CALLBACK_MEMBER(csplayh5_irq);
DECLARE_WRITE_LINE_MEMBER(csplayh5_vdp0_interrupt);
+ required_device<dac_device> m_dac1;
+ required_device<dac_device> m_dac2;
};
@@ -235,10 +239,10 @@ WRITE8_MEMBER(csplayh5_state::tmpz84c011_pio_w)
csplayh5_soundbank_w(machine(), data & 0x03);
break;
case 1: /* PB_0 */
- machine().device<dac_device>("dac2")->DAC_WRITE(data);
+ m_dac2->DAC_WRITE(data);
break;
case 2: /* PC_0 */
- machine().device<dac_device>("dac1")->DAC_WRITE(data);
+ m_dac1->DAC_WRITE(data);
break;
case 3: /* PD_0 */
break;
diff --git a/src/mame/drivers/cvs.c b/src/mame/drivers/cvs.c
index 8f619510455..6ebfa23acb9 100644
--- a/src/mame/drivers/cvs.c
+++ b/src/mame/drivers/cvs.c
@@ -312,7 +312,6 @@ void cvs_state::start_393hz_timer()
WRITE8_MEMBER(cvs_state::cvs_4_bit_dac_data_w)
{
- dac_device *device = machine().device<dac_device>("dac2");
UINT8 dac_value;
static int old_data[4] = {0,0,0,0};
@@ -330,7 +329,7 @@ WRITE8_MEMBER(cvs_state::cvs_4_bit_dac_data_w)
(m_cvs_4_bit_dac_data[3] << 3);
/* scale up to a full byte and output */
- device->write_unsigned8((dac_value << 4) | dac_value);
+ m_dac2->write_unsigned8((dac_value << 4) | dac_value);
}
WRITE8_MEMBER(cvs_state::cvs_unknown_w)
@@ -983,7 +982,6 @@ MACHINE_START_MEMBER(cvs_state,cvs)
/* set devices */
m_speech = machine().device("speech");
- m_dac3 = machine().device<dac_device>("dac3");
m_tms = machine().device("tms");
m_s2636_0 = machine().device("s2636_0");
m_s2636_1 = machine().device("s2636_1");
diff --git a/src/mame/drivers/equites.c b/src/mame/drivers/equites.c
index 64da90ab1ad..2d96ea21699 100644
--- a/src/mame/drivers/equites.c
+++ b/src/mame/drivers/equites.c
@@ -1185,8 +1185,6 @@ MACHINE_CONFIG_END
MACHINE_START_MEMBER(equites_state,equites)
{
m_msm = machine().device<msm5232_device>("msm");
- m_dac_1 = machine().device<dac_device>("dac1");
- m_dac_2 = machine().device<dac_device>("dac2");
save_item(NAME(m_fg_char_bank));
save_item(NAME(m_bgcolor));
diff --git a/src/mame/drivers/ertictac.c b/src/mame/drivers/ertictac.c
index 6c25646e70c..5815a1ca0eb 100644
--- a/src/mame/drivers/ertictac.c
+++ b/src/mame/drivers/ertictac.c
@@ -202,7 +202,7 @@ void ertictac_state::machine_start()
archimedes_init();
// reset the DAC to centerline
- //machine().device<dac_device>("dac")->write_signed8(0x80);
+ //m_dac->write_signed8(0x80);
}
void ertictac_state::machine_reset()
diff --git a/src/mame/drivers/esripsys.c b/src/mame/drivers/esripsys.c
index 2e4cfa5b149..de744b84447 100644
--- a/src/mame/drivers/esripsys.c
+++ b/src/mame/drivers/esripsys.c
@@ -557,7 +557,6 @@ WRITE8_MEMBER(esripsys_state::control_w)
/* 10-bit MC3410CL DAC */
WRITE8_MEMBER(esripsys_state::esripsys_dac_w)
{
- dac_device *device = machine().device<dac_device>("dac");
if (offset == 0)
{
m_dac_msb = data & 3;
@@ -570,7 +569,7 @@ WRITE8_MEMBER(esripsys_state::esripsys_dac_w)
The 8-bit DAC modulates the 10-bit DAC.
Shift down to prevent clipping.
*/
- device->write_signed16((m_dac_vol * dac_data) >> 1);
+ m_dac->write_signed16((m_dac_vol * dac_data) >> 1);
}
}
diff --git a/src/mame/drivers/exterm.c b/src/mame/drivers/exterm.c
index 2e7a4bc0a43..0334f19de10 100644
--- a/src/mame/drivers/exterm.c
+++ b/src/mame/drivers/exterm.c
@@ -238,10 +238,9 @@ READ8_MEMBER(exterm_state::sound_slave_latch_r)
WRITE8_MEMBER(exterm_state::sound_slave_dac_w)
{
- dac_device *device = machine().device<dac_device>("dac");
/* DAC A is used to modulate DAC B */
m_dac_value[offset & 1] = data;
- device->write_unsigned16((m_dac_value[0] ^ 0xff) * m_dac_value[1]);
+ m_dac->write_unsigned16((m_dac_value[0] ^ 0xff) * m_dac_value[1]);
}
diff --git a/src/mame/drivers/galaxian.c b/src/mame/drivers/galaxian.c
index c0dc7ca84e9..aa7162c6712 100644
--- a/src/mame/drivers/galaxian.c
+++ b/src/mame/drivers/galaxian.c
@@ -779,7 +779,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) machine().device<dac_device>("dac")->write_signed8(data);
+ if (offset & 0x10) m_dac->write_signed8(data);
}
@@ -1182,8 +1182,7 @@ WRITE8_MEMBER(galaxian_state::kingball_sound2_w)
WRITE8_MEMBER(galaxian_state::kingball_dac_w)
{
- dac_device *device = machine().device<dac_device>("dac");
- device->write_unsigned8(data ^ 0xff);
+ m_dac->write_unsigned8(data ^ 0xff);
}
diff --git a/src/mame/drivers/gei.c b/src/mame/drivers/gei.c
index e61624db5ba..4013b320b6b 100644
--- a/src/mame/drivers/gei.c
+++ b/src/mame/drivers/gei.c
@@ -82,7 +82,8 @@ class gei_state : public driver_device
public:
gei_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
- m_maincpu(*this, "maincpu") { }
+ m_maincpu(*this, "maincpu"),
+ m_dac(*this, "dac") { }
virtual void video_start();
@@ -137,6 +138,7 @@ public:
DECLARE_PALETTE_INIT(quizvid);
INTERRUPT_GEN_MEMBER(vblank_irq);
required_device<cpu_device> m_maincpu;
+ required_device<dac_device> m_dac;
};
@@ -228,7 +230,7 @@ WRITE8_MEMBER(gei_state::sound_w)
m_nmi_mask = data & 0x40;
/* bit 7 goes directly to the sound amplifier */
- machine().device<dac_device>("dac")->write_unsigned8(((data & 0x80) >> 7) * 255);
+ m_dac->write_unsigned8(((data & 0x80) >> 7) * 255);
}
WRITE8_MEMBER(gei_state::sound2_w)
@@ -245,7 +247,7 @@ WRITE8_MEMBER(gei_state::sound2_w)
set_led_status(machine(), 12,data & 0x20);
/* bit 7 goes directly to the sound amplifier */
- machine().device<dac_device>("dac")->write(((data & 0x80) >> 7) * 255);
+ m_dac->write(((data & 0x80) >> 7) * 255);
}
WRITE8_MEMBER(gei_state::lamps2_w)
diff --git a/src/mame/drivers/homedata.c b/src/mame/drivers/homedata.c
index 82e5f07f48b..b7d978530ee 100644
--- a/src/mame/drivers/homedata.c
+++ b/src/mame/drivers/homedata.c
@@ -1142,7 +1142,6 @@ MACHINE_START_MEMBER(homedata_state,homedata)
{
m_ym = machine().device("ymsnd");
m_sn = machine().device<sn76489a_device>("snsnd");
- m_dac = machine().device<dac_device>("dac");
save_item(NAME(m_visible_page));
save_item(NAME(m_flipscreen));
diff --git a/src/mame/drivers/looping.c b/src/mame/drivers/looping.c
index bae94d1b793..61e6e2b53b5 100644
--- a/src/mame/drivers/looping.c
+++ b/src/mame/drivers/looping.c
@@ -103,7 +103,8 @@ public:
m_colorram(*this, "colorram"),
m_spriteram(*this, "spriteram"),
m_maincpu(*this, "maincpu"),
- m_audiocpu(*this, "audiocpu") { }
+ m_audiocpu(*this, "audiocpu"),
+ m_dac(*this, "dac") { }
/* memory pointers */
required_shared_ptr<UINT8> m_videoram;
@@ -149,6 +150,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;
};
@@ -386,7 +388,6 @@ WRITE8_MEMBER(looping_state::looping_soundlatch_w)
WRITE8_MEMBER(looping_state::looping_sound_sw)
{
- dac_device *device = machine().device<dac_device>("dac");
/* this can be improved by adding the missing signals for decay etc. (see schematics)
0001 = ASOV
@@ -399,7 +400,7 @@ WRITE8_MEMBER(looping_state::looping_sound_sw)
*/
m_sound[offset + 1] = data ^ 1;
- device->write_unsigned8(((m_sound[2] << 7) + (m_sound[3] << 6)) * m_sound[7]);
+ m_dac->write_unsigned8(((m_sound[2] << 7) + (m_sound[3] << 6)) * m_sound[7]);
}
diff --git a/src/mame/drivers/m72.c b/src/mame/drivers/m72.c
index d2b601aab49..521dc915a96 100644
--- a/src/mame/drivers/m72.c
+++ b/src/mame/drivers/m72.c
@@ -338,9 +338,8 @@ WRITE8_MEMBER(m72_state::m72_mcu_high_w)
WRITE8_MEMBER(m72_state::m72_snd_cpu_sample_w)
{
- dac_device *device = machine().device<dac_device>("dac");
- //device->write_signed8(data);
- device->write_unsigned8(data);
+ //m_dac->write_signed8(data);
+ m_dac->write_unsigned8(data);
}
READ8_MEMBER(m72_state::m72_snd_cpu_sample_r)
diff --git a/src/mame/drivers/magicfly.c b/src/mame/drivers/magicfly.c
index 83dddaa5c20..e78d22041f2 100644
--- a/src/mame/drivers/magicfly.c
+++ b/src/mame/drivers/magicfly.c
@@ -449,7 +449,8 @@ public:
: driver_device(mconfig, type, tag),
m_videoram(*this, "videoram"),
m_colorram(*this, "colorram"),
- m_maincpu(*this, "maincpu") { }
+ m_maincpu(*this, "maincpu"),
+ m_dac(*this, "dac") { }
required_shared_ptr<UINT8> m_videoram;
required_shared_ptr<UINT8> m_colorram;
@@ -467,6 +468,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;
};
@@ -646,7 +648,7 @@ WRITE8_MEMBER(magicfly_state::mux_port_w)
*/
m_input_selector = data & 0x0f; /* Input Selector */
- machine().device<dac_device>("dac")->write_unsigned8(data & 0x80); /* Sound DAC */
+ m_dac->write_unsigned8(data & 0x80); /* Sound DAC */
coin_counter_w(machine(), 0, data & 0x40); /* Coin1 */
coin_counter_w(machine(), 1, data & 0x10); /* Coin2 */
diff --git a/src/mame/drivers/mappy.c b/src/mame/drivers/mappy.c
index 5e558d60192..f145e399cab 100644
--- a/src/mame/drivers/mappy.c
+++ b/src/mame/drivers/mappy.c
@@ -2238,8 +2238,7 @@ ROM_END
WRITE8_MEMBER(mappy_state::grobda_DAC_w)
{
- dac_device *device = machine().device<dac_device>("dac");
- device->write_unsigned8((data << 4) | data);
+ m_dac->write_unsigned8((data << 4) | data);
}
DRIVER_INIT_MEMBER(mappy_state,grobda)
diff --git a/src/mame/drivers/meyc8080.c b/src/mame/drivers/meyc8080.c
index 8193caaea4d..a98fc7511ee 100644
--- a/src/mame/drivers/meyc8080.c
+++ b/src/mame/drivers/meyc8080.c
@@ -71,7 +71,8 @@ public:
m_videoram_0(*this, "vram0"),
m_videoram_1(*this, "vram1"),
m_videoram_2(*this, "vram2"),
- m_maincpu(*this, "maincpu") { }
+ m_maincpu(*this, "maincpu"),
+ m_dac(*this, "dac") { }
required_shared_ptr<UINT8> m_videoram_0;
required_shared_ptr<UINT8> m_videoram_1;
@@ -86,6 +87,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;
};
@@ -272,29 +274,25 @@ WRITE8_MEMBER(meyc8080_state::counters_w)
WRITE8_MEMBER(meyc8080_state::meyc8080_dac_1_w)
{
- dac_device *device = machine().device<dac_device>("dac");
- device->write_unsigned8(0x00);
+ m_dac->write_unsigned8(0x00);
}
WRITE8_MEMBER(meyc8080_state::meyc8080_dac_2_w)
{
- dac_device *device = machine().device<dac_device>("dac");
- device->write_unsigned8(0x55);
+ m_dac->write_unsigned8(0x55);
}
WRITE8_MEMBER(meyc8080_state::meyc8080_dac_3_w)
{
- dac_device *device = machine().device<dac_device>("dac");
- device->write_unsigned8(0xaa);
+ m_dac->write_unsigned8(0xaa);
}
WRITE8_MEMBER(meyc8080_state::meyc8080_dac_4_w)
{
- dac_device *device = machine().device<dac_device>("dac");
- device->write_unsigned8(0xff);
+ m_dac->write_unsigned8(0xff);
}
diff --git a/src/mame/drivers/meyc8088.c b/src/mame/drivers/meyc8088.c
index 68ff8c1375b..863da881b78 100644
--- a/src/mame/drivers/meyc8088.c
+++ b/src/mame/drivers/meyc8088.c
@@ -40,12 +40,14 @@ public:
: driver_device(mconfig, type, tag),
m_maincpu(*this,"maincpu"),
m_vram(*this, "vram"),
- m_heartbeat(*this, "heartbeat")
+ m_heartbeat(*this, "heartbeat"),
+ m_dac(*this, "dac")
{ }
required_device<cpu_device> m_maincpu;
required_shared_ptr<UINT8> m_vram;
required_device<timer_device> m_heartbeat;
+ required_device<dac_device> m_dac;
UINT8 m_status;
UINT8 m_common;
@@ -276,7 +278,7 @@ WRITE8_MEMBER(meyc8088_state::meyc8088_common_w)
WRITE_LINE_MEMBER(meyc8088_state::meyc8088_sound_out)
{
- machine().device<dac_device>("dac")->write_signed8(state ? 0x7f : 0);
+ m_dac->write_signed8(state ? 0x7f : 0);
}
diff --git a/src/mame/drivers/mjsister.c b/src/mame/drivers/mjsister.c
index 26f97e0919a..120a69c223c 100644
--- a/src/mame/drivers/mjsister.c
+++ b/src/mame/drivers/mjsister.c
@@ -455,8 +455,6 @@ void mjsister_state::machine_start()
membank("bank1")->configure_entries(0, 4, &ROM[0x10000], 0x8000);
- m_dac = machine().device<dac_device>("dac");
-
save_item(NAME(m_dac_busy));
save_item(NAME(m_flip_screen));
save_item(NAME(m_video_enable));
diff --git a/src/mame/drivers/mogura.c b/src/mame/drivers/mogura.c
index f13e22c2666..f39cd9ea0e3 100644
--- a/src/mame/drivers/mogura.c
+++ b/src/mame/drivers/mogura.c
@@ -193,8 +193,6 @@ GFXDECODE_END
void mogura_state::machine_start()
{
- m_dac1 = machine().device<dac_device>("dac1");
- m_dac2 = machine().device<dac_device>("dac2");
}
static MACHINE_CONFIG_START( mogura, mogura_state )
diff --git a/src/mame/drivers/mpoker.c b/src/mame/drivers/mpoker.c
index 8d4d66bde24..bc198854c3e 100644
--- a/src/mame/drivers/mpoker.c
+++ b/src/mame/drivers/mpoker.c
@@ -470,7 +470,7 @@ WRITE8_MEMBER(mpoker_state::outport7_w)
WRITE8_MEMBER(mpoker_state::sound_w)
//{
-// machine().device<dac_device>("dac")->write_unsigned8(data);
+// m_dac->write_unsigned8(data);
//}
*/
diff --git a/src/mame/drivers/murogem.c b/src/mame/drivers/murogem.c
index 69fefd1a7af..6c581f4647e 100644
--- a/src/mame/drivers/murogem.c
+++ b/src/mame/drivers/murogem.c
@@ -116,13 +116,15 @@ public:
murogem_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_videoram(*this, "videoram"),
- m_maincpu(*this, "maincpu") { }
+ m_maincpu(*this, "maincpu"),
+ m_dac(*this, "dac") { }
required_shared_ptr<UINT8> m_videoram;
DECLARE_WRITE8_MEMBER(outport_w);
virtual void palette_init();
UINT32 screen_update_murogem(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
required_device<cpu_device> m_maincpu;
+ required_device<dac_device> m_dac;
};
@@ -135,7 +137,7 @@ WRITE8_MEMBER(murogem_state::outport_w)
7654 3210
---- x--- Sound DAC.
*/
- machine().device<dac_device>("dac")->write_unsigned8(data & 0x08);
+ m_dac->write_unsigned8(data & 0x08);
}
diff --git a/src/mame/drivers/nbmj9195.c b/src/mame/drivers/nbmj9195.c
index 08d0a39288c..f5d2edef254 100644
--- a/src/mame/drivers/nbmj9195.c
+++ b/src/mame/drivers/nbmj9195.c
@@ -327,10 +327,10 @@ WRITE8_MEMBER(nbmj9195_state::tmpz84c011_pio_w)
nbmj9195_soundbank_w(space, 0, data);
break;
case 6: /* PB_1 */
- machine().device<dac_device>("dac2")->write_unsigned8(data);
+ m_dac2->write_unsigned8(data);
break;
case 7: /* PC_1 */
- machine().device<dac_device>("dac1")->write_unsigned8(data);
+ m_dac1->write_unsigned8(data);
break;
case 8: /* PD_1 */
break;
@@ -365,10 +365,10 @@ WRITE8_MEMBER(nbmj9195_state::tmpz84c011_pio_w)
nbmj9195_soundbank_w(space, 0, data);
break;
case 6: /* PB_1 */
- machine().device<dac_device>("dac1")->write_unsigned8(data);
+ m_dac1->write_unsigned8(data);
break;
case 7: /* PC_1 */
- machine().device<dac_device>("dac2")->write_unsigned8(data);
+ m_dac2->write_unsigned8(data);
break;
case 8: /* PD_1 */
break;
diff --git a/src/mame/drivers/niyanpai.c b/src/mame/drivers/niyanpai.c
index 5ec0dbc23f9..fb15e54efcc 100644
--- a/src/mame/drivers/niyanpai.c
+++ b/src/mame/drivers/niyanpai.c
@@ -112,10 +112,10 @@ WRITE8_MEMBER(niyanpai_state::tmpz84c011_pio_w)
niyanpai_soundbank_w(data & 0x03);
break;
case 1: /* PB_0 */
- machine().device<dac_device>("dac1")->write_unsigned8(data);
+ m_dac1->write_unsigned8(data);
break;
case 2: /* PC_0 */
- machine().device<dac_device>("dac2")->write_unsigned8(data);
+ m_dac2->write_unsigned8(data);
break;
case 3: /* PD_0 */
break;
diff --git a/src/mame/drivers/ppmast93.c b/src/mame/drivers/ppmast93.c
index 6d5fc4e8fdb..00b5c3b3aad 100644
--- a/src/mame/drivers/ppmast93.c
+++ b/src/mame/drivers/ppmast93.c
@@ -143,7 +143,8 @@ public:
: driver_device(mconfig, type, tag),
m_bgram(*this, "bgram"),
m_fgram(*this, "fgram"),
- m_maincpu(*this, "maincpu") { }
+ m_maincpu(*this, "maincpu"),
+ m_dac(*this, "dac") { }
tilemap_t *m_fg_tilemap;
tilemap_t *m_bg_tilemap;
@@ -158,6 +159,7 @@ public:
virtual void video_start();
UINT32 screen_update_ppmast93(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
required_device<cpu_device> m_maincpu;
+ required_device<dac_device> m_dac;
};
@@ -221,7 +223,7 @@ WRITE8_MEMBER(ppmast93_state::ppmast_sound_w)
{
case 0:
case 1: ym2413_w(machine().device("ymsnd"),space,offset,data); break;
- case 2: machine().device<dac_device>("dac")->write_unsigned8(data);break;
+ case 2: m_dac->write_unsigned8(data);break;
default: logerror("%x %x - %x\n",offset,data,space.device().safe_pcbase());
}
}
diff --git a/src/mame/drivers/quizshow.c b/src/mame/drivers/quizshow.c
index d649d78466c..04b9f6c3337 100644
--- a/src/mame/drivers/quizshow.c
+++ b/src/mame/drivers/quizshow.c
@@ -39,7 +39,8 @@ public:
: driver_device(mconfig, type, tag),
m_main_ram(*this, "main_ram"),
m_fo_state(*this, "fo_state"),
- m_maincpu(*this, "maincpu") { }
+ m_maincpu(*this, "maincpu"),
+ m_dac(*this, "dac") { }
tilemap_t *m_tilemap;
required_shared_ptr<UINT8> m_main_ram;
@@ -67,6 +68,7 @@ public:
UINT32 screen_update_quizshow(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(quizshow_clock_timer_cb);
required_device<cpu_device> m_maincpu;
+ required_device<dac_device> m_dac;
};
@@ -167,7 +169,7 @@ WRITE8_MEMBER(quizshow_state::quizshow_tape_control_w)
WRITE8_MEMBER(quizshow_state::quizshow_audio_w)
{
// d1: audio out
- machine().device<dac_device>("dac")->write_signed8((data & 2) ? 0x7f : 0);
+ m_dac->write_signed8((data & 2) ? 0x7f : 0);
// d0, d2-d7: N/C
}
diff --git a/src/mame/drivers/rltennis.c b/src/mame/drivers/rltennis.c
index 92e9efb51ee..98107751fbf 100644
--- a/src/mame/drivers/rltennis.c
+++ b/src/mame/drivers/rltennis.c
@@ -154,8 +154,6 @@ INTERRUPT_GEN_MEMBER(rltennis_state::rltennis_interrupt)
void rltennis_state::machine_start()
{
m_screen = machine().device( "screen");
- m_dac_1 = machine().device<dac_device>("dac1");
- m_dac_2 = machine().device<dac_device>("dac2");
m_samples_1 = memregion("samples1")->base();
m_samples_2 = memregion("samples2")->base();
m_gfx = memregion("gfx1")->base();
diff --git a/src/mame/drivers/sbrkout.c b/src/mame/drivers/sbrkout.c
index 38df1f8198a..81dcbb92bde 100644
--- a/src/mame/drivers/sbrkout.c
+++ b/src/mame/drivers/sbrkout.c
@@ -43,7 +43,8 @@ public:
sbrkout_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_videoram(*this, "videoram"),
- m_maincpu(*this, "maincpu") { }
+ m_maincpu(*this, "maincpu"),
+ m_dac(*this, "dac") { }
required_shared_ptr<UINT8> m_videoram;
emu_timer *m_scanline_timer;
@@ -72,6 +73,7 @@ public:
TIMER_CALLBACK_MEMBER(pot_trigger_callback);
void update_nmi_state();
required_device<cpu_device> m_maincpu;
+ required_device<dac_device> m_dac;
};
@@ -144,7 +146,7 @@ TIMER_CALLBACK_MEMBER(sbrkout_state::scanline_callback)
m_maincpu->set_input_line(0, ASSERT_LINE);
/* update the DAC state */
- machine().device<dac_device>("dac")->write_unsigned8((videoram[0x380 + 0x11] & (scanline >> 2)) ? 255 : 0);
+ m_dac->write_unsigned8((videoram[0x380 + 0x11] & (scanline >> 2)) ? 255 : 0);
/* on the VBLANK, read the pot and schedule an interrupt time for it */
if (scanline == machine().primary_screen->visible_area().max_y + 1)
diff --git a/src/mame/drivers/segas24.c b/src/mame/drivers/segas24.c
index fcee057b3b2..099ff6df674 100644
--- a/src/mame/drivers/segas24.c
+++ b/src/mame/drivers/segas24.c
@@ -598,7 +598,7 @@ void segas24_state::mahmajn_io_w(UINT8 port, UINT8 data)
cur_input_line = (cur_input_line + 1) & 7;
break;
case 7: // DAC
- machine().device<dac_device>("dac")->write_signed8(data);
+ m_dac->write_signed8(data);
break;
default:
fprintf(stderr, "Port %d : %02x\n", port, data & 0xff);
@@ -612,7 +612,7 @@ void segas24_state::hotrod_io_w(UINT8 port, UINT8 data)
case 3: // Lamps
break;
case 7: // DAC
- machine().device<dac_device>("dac")->write_signed8(data);
+ m_dac->write_signed8(data);
break;
default:
fprintf(stderr, "Port %d : %02x\n", port, data & 0xff);
diff --git a/src/mame/drivers/suna16.c b/src/mame/drivers/suna16.c
index b5776cdcc3b..ef90b85a03b 100644
--- a/src/mame/drivers/suna16.c
+++ b/src/mame/drivers/suna16.c
@@ -325,23 +325,19 @@ ADDRESS_MAP_END
WRITE8_MEMBER(suna16_state::bssoccer_DAC1_w)
{
- dac_device *device = machine().device<dac_device>("dac1");
- device->write_unsigned8( (data & 0xf) * 0x11 );
+ m_dac1->write_unsigned8( (data & 0xf) * 0x11 );
}
WRITE8_MEMBER(suna16_state::bssoccer_DAC2_w)
{
- dac_device *device = machine().device<dac_device>("dac2");
- device->write_unsigned8( (data & 0xf) * 0x11 );
+ m_dac2->write_unsigned8( (data & 0xf) * 0x11 );
}
WRITE8_MEMBER(suna16_state::bssoccer_DAC3_w)
{
- dac_device *device = machine().device<dac_device>("dac3");
- device->write_unsigned8( (data & 0xf) * 0x11 );
+ m_dac3->write_unsigned8( (data & 0xf) * 0x11 );
}
WRITE8_MEMBER(suna16_state::bssoccer_DAC4_w)
{
- dac_device *device = machine().device<dac_device>("dac4");
- device->write_unsigned8( (data & 0xf) * 0x11 );
+ m_dac4->write_unsigned8( (data & 0xf) * 0x11 );
}
static ADDRESS_MAP_START( bssoccer_pcm_1_io_map, AS_IO, 8, suna16_state )
diff --git a/src/mame/drivers/taitosj.c b/src/mame/drivers/taitosj.c
index e5186ab9584..319d6a1194f 100644
--- a/src/mame/drivers/taitosj.c
+++ b/src/mame/drivers/taitosj.c
@@ -1731,16 +1731,14 @@ static const UINT8 voltable[256] =
WRITE8_MEMBER(taitosj_state::dac_out_w)
{
- dac_device *device = machine().device<dac_device>("dac");
m_dac_out = data - 0x80;
- device->write_signed16(m_dac_out * m_dac_vol + 0x8000);
+ m_dac->write_signed16(m_dac_out * m_dac_vol + 0x8000);
}
WRITE8_MEMBER(taitosj_state::dac_vol_w)
{
- dac_device *device = machine().device<dac_device>("dac");
m_dac_vol = voltable[data];
- device->write_signed16(m_dac_out * m_dac_vol + 0x8000);
+ m_dac->write_signed16(m_dac_out * m_dac_vol + 0x8000);
}
diff --git a/src/mame/drivers/tceptor.c b/src/mame/drivers/tceptor.c
index afa84fb70db..05881722e1f 100644
--- a/src/mame/drivers/tceptor.c
+++ b/src/mame/drivers/tceptor.c
@@ -89,8 +89,7 @@ WRITE8_MEMBER(tceptor_state::mcu_irq_disable_w)
WRITE8_MEMBER(tceptor_state::voice_w)
{
- dac_device *device = machine().device<dac_device>("dac");
- device->write_signed16(data ? (data + 1) * 0x100 : 0x8000);
+ m_dac->write_signed16(data ? (data + 1) * 0x100 : 0x8000);
}
diff --git a/src/mame/drivers/tnzs.c b/src/mame/drivers/tnzs.c
index 45fc50db14b..49bc17d4ce0 100644
--- a/src/mame/drivers/tnzs.c
+++ b/src/mame/drivers/tnzs.c
@@ -742,10 +742,9 @@ WRITE8_MEMBER(tnzs_state::kabukiz_sound_bank_w)
WRITE8_MEMBER(tnzs_state::kabukiz_sample_w)
{
- dac_device *device = machine().device<dac_device>("dac");
// to avoid the write when the sound chip is initialized
if (data != 0xff)
- device->write_unsigned8(data);
+ m_dac->write_unsigned8(data);
}
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, tnzs_state )
diff --git a/src/mame/drivers/truco.c b/src/mame/drivers/truco.c
index 1ae96be9b03..d4425d22f4b 100644
--- a/src/mame/drivers/truco.c
+++ b/src/mame/drivers/truco.c
@@ -238,7 +238,7 @@ WRITE8_MEMBER(truco_state::portb_w)
{
if ((data & 0x80) | (data == 0))
{
- machine().device<dac_device>("dac")->write_unsigned8(data & 0x80); /* Isolated the bit for Delta-Sigma DAC */
+ m_dac->write_unsigned8(data & 0x80); /* Isolated the bit for Delta-Sigma DAC */
}
else
logerror("Port B writes: %2x\n", data);
diff --git a/src/mame/drivers/trucocl.c b/src/mame/drivers/trucocl.c
index 4bc3389d78d..b75fa9aabba 100644
--- a/src/mame/drivers/trucocl.c
+++ b/src/mame/drivers/trucocl.c
@@ -50,7 +50,6 @@ TIMER_CALLBACK_MEMBER(trucocl_state::dac_irq)
WRITE8_MEMBER(trucocl_state::audio_dac_w)
{
- dac_device *device = machine().device<dac_device>("dac");
UINT8 *rom = memregion("maincpu")->base();
int dac_address = ( data & 0xf0 ) << 8;
int sel = ( ( (~data) >> 1 ) & 2 ) | ( data & 1 );
@@ -73,7 +72,7 @@ WRITE8_MEMBER(trucocl_state::audio_dac_w)
dac_address += 0x10000;
- device->write_unsigned8( rom[dac_address+m_cur_dac_address_index] );
+ m_dac->write_unsigned8( rom[dac_address+m_cur_dac_address_index] );
machine().scheduler().timer_set( attotime::from_hz( 16000 ), timer_expired_delegate(FUNC(trucocl_state::dac_irq),this));
}
diff --git a/src/mame/drivers/unkhorse.c b/src/mame/drivers/unkhorse.c
index c661e221f19..b26833c2cd8 100644
--- a/src/mame/drivers/unkhorse.c
+++ b/src/mame/drivers/unkhorse.c
@@ -30,7 +30,8 @@ public:
: driver_device(mconfig, type, tag),
m_video_ram(*this, "video_ram"),
m_color_ram(*this, "color_ram"),
- m_maincpu(*this, "maincpu") { }
+ m_maincpu(*this, "maincpu"),
+ m_dac(*this, "dac") { }
required_shared_ptr<UINT8> m_video_ram;
required_shared_ptr<UINT8> m_color_ram;
@@ -42,6 +43,7 @@ public:
UINT32 screen_update_horse(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(horse_interrupt);
required_device<cpu_device> m_maincpu;
+ required_device<dac_device> m_dac;
};
@@ -119,7 +121,7 @@ WRITE8_MEMBER(horse_state::horse_output_w)
WRITE_LINE_MEMBER(horse_state::horse_timer_out)
{
- machine().device<dac_device>("dac")->write_signed8(state ? 0x7f : 0);
+ m_dac->write_signed8(state ? 0x7f : 0);
}
static I8155_INTERFACE(i8155_intf)
diff --git a/src/mame/drivers/vcombat.c b/src/mame/drivers/vcombat.c
index 775e61f0d37..97240c905ec 100644
--- a/src/mame/drivers/vcombat.c
+++ b/src/mame/drivers/vcombat.c
@@ -100,7 +100,8 @@ public:
m_vid_1_shared_ram(*this, "vid_1_ram"),
m_framebuffer_ctrl(*this, "fb_control"),
m_maincpu(*this, "maincpu"),
- m_soundcpu(*this, "soundcpu"){ }
+ m_soundcpu(*this, "soundcpu"),
+ m_dac(*this, "dac") { }
UINT16* m_m68k_framebuffer[2];
UINT16* m_i860_framebuffer[2][2];
@@ -132,6 +133,7 @@ public:
UINT32 screen_update_vcombat_aux(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_soundcpu;
+ required_device<dac_device> m_dac;
};
static UINT32 update_screen(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, int index)
@@ -339,9 +341,8 @@ WRITE16_MEMBER(vcombat_state::crtc_w)
WRITE16_MEMBER(vcombat_state::vcombat_dac_w)
{
- dac_device *device = machine().device<dac_device>("dac");
INT16 newval = ((INT16)data - 0x6000) << 2;
- device->write_signed16(newval + 0x8000);
+ m_dac->write_signed16(newval + 0x8000);
}
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, vcombat_state )
diff --git a/src/mame/drivers/videopkr.c b/src/mame/drivers/videopkr.c
index cb47dfd7c4c..92ccaeae1dc 100644
--- a/src/mame/drivers/videopkr.c
+++ b/src/mame/drivers/videopkr.c
@@ -302,7 +302,8 @@ public:
videopkr_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
- m_soundcpu(*this, "soundcpu") { }
+ m_soundcpu(*this, "soundcpu"),
+ m_dac(*this, "dac") { }
UINT8 m_data_ram[0x100];
UINT8 m_video_ram[0x0400];
@@ -369,6 +370,7 @@ public:
TIMER_DEVICE_CALLBACK_MEMBER(sound_t1_callback);
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_soundcpu;
+ required_device<dac_device> m_dac;
};
@@ -892,9 +894,8 @@ READ8_MEMBER(videopkr_state::baby_sound_p2_r)
WRITE8_MEMBER(videopkr_state::baby_sound_p2_w)
{
- dac_device *device = machine().device<dac_device>("dac");
m_sbp2 = data;
- device->write_unsigned8(data);
+ m_dac->write_unsigned8(data);
}
READ8_MEMBER(videopkr_state::baby_sound_p3_r)
diff --git a/src/mame/drivers/zaccaria.c b/src/mame/drivers/zaccaria.c
index ebd509bb1ec..1da18195a91 100644
--- a/src/mame/drivers/zaccaria.c
+++ b/src/mame/drivers/zaccaria.c
@@ -190,8 +190,7 @@ WRITE8_MEMBER(zaccaria_state::sound1_command_w)
WRITE8_MEMBER(zaccaria_state::mc1408_data_w)
{
- dac_device *device = machine().device<dac_device>("dac2");
- device->write_unsigned8(data);
+ m_dac2->write_unsigned8(data);
}
diff --git a/src/mame/includes/cchasm.h b/src/mame/includes/cchasm.h
index bddd437649b..d70c737450b 100644
--- a/src/mame/includes/cchasm.h
+++ b/src/mame/includes/cchasm.h
@@ -5,6 +5,7 @@
*************************************************************************/
#include "machine/z80ctc.h"
+#include "sound/dac.h"
class cchasm_state : public driver_device
{
@@ -13,7 +14,9 @@ public:
: driver_device(mconfig, type, tag),
m_ram(*this, "ram"),
m_maincpu(*this, "maincpu"),
- m_audiocpu(*this, "audiocpu") { }
+ m_audiocpu(*this, "audiocpu"),
+ m_dac1(*this, "dac1"),
+ m_dac2(*this, "dac2") { }
int m_sound_flags;
int m_coin_flag;
@@ -40,6 +43,8 @@ public:
void cchasm_refresh ();
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
+ required_device<dac_device> m_dac1;
+ required_device<dac_device> m_dac2;
};
/*----------- defined in audio/cchasm.c -----------*/
diff --git a/src/mame/includes/champbas.h b/src/mame/includes/champbas.h
index 8434a93c3c3..85774d1537d 100644
--- a/src/mame/includes/champbas.h
+++ b/src/mame/includes/champbas.h
@@ -6,7 +6,7 @@
#define CPUTAG_MCU "mcu"
-
+#include "sound/dac.h"
class champbas_state : public driver_device
{
@@ -18,7 +18,10 @@ public:
m_spriteram_2(*this, "spriteram_2"),
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
- m_mcu(*this, CPUTAG_MCU){ }
+ m_mcu(*this, CPUTAG_MCU),
+ m_dac(*this, "dac"),
+ m_dac1(*this, "dac1"),
+ m_dac2(*this, "dac2"){ }
/* memory pointers */
required_shared_ptr<UINT8> m_bg_videoram;
@@ -70,4 +73,7 @@ public:
TIMER_CALLBACK_MEMBER(exctsccr_fm_callback);
void champbas_draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect );
void exctsccr_draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect );
+ optional_device<dac_device> m_dac;
+ optional_device<dac_device> m_dac1;
+ optional_device<dac_device> m_dac2;
};
diff --git a/src/mame/includes/cheekyms.h b/src/mame/includes/cheekyms.h
index 95367904ae7..8e3c353b943 100644
--- a/src/mame/includes/cheekyms.h
+++ b/src/mame/includes/cheekyms.h
@@ -13,7 +13,8 @@ public:
m_videoram(*this, "videoram"),
m_spriteram(*this, "spriteram"),
m_port_80(*this, "port_80"),
- m_maincpu(*this, "maincpu"){ }
+ m_maincpu(*this, "maincpu"),
+ m_dac(*this, "dac"){ }
/* memory pointers */
required_shared_ptr<UINT8> m_videoram;
@@ -26,7 +27,7 @@ public:
/* devices */
required_device<cpu_device> m_maincpu;
- dac_device *m_dac;
+ required_device<dac_device> m_dac;
UINT8 m_irq_mask;
DECLARE_WRITE8_MEMBER(cheekyms_port_40_w);
diff --git a/src/mame/includes/circusc.h b/src/mame/includes/circusc.h
index 7e61ee0d8a5..bdd43d26cd8 100644
--- a/src/mame/includes/circusc.h
+++ b/src/mame/includes/circusc.h
@@ -21,6 +21,7 @@ public:
m_audiocpu(*this, "audiocpu"),
m_sn_1(*this, "sn1"),
m_sn_2(*this, "sn2"),
+ m_dac(*this, "dac"),
m_discrete(*this, "fltdisc"),
m_maincpu(*this, "maincpu") { }
@@ -42,7 +43,7 @@ public:
required_device<cpu_device> m_audiocpu;
required_device<sn76496_device> m_sn_1;
required_device<sn76496_device> m_sn_2;
- dac_device *m_dac;
+ required_device<dac_device> m_dac;
required_device<discrete_device> m_discrete;
UINT8 m_irq_mask;
diff --git a/src/mame/includes/coolpool.h b/src/mame/includes/coolpool.h
index 87a593e6f40..135260b2b2c 100644
--- a/src/mame/includes/coolpool.h
+++ b/src/mame/includes/coolpool.h
@@ -1,4 +1,5 @@
#define NVRAM_UNLOCK_SEQ_LEN 10
+#include "sound/dac.h"
class coolpool_state : public driver_device
{
@@ -8,7 +9,8 @@ public:
m_tlc34076(*this, "tlc34076"),
m_vram_base(*this, "vram_base"),
m_nvram(*this, "nvram"),
- m_maincpu(*this, "maincpu"){ }
+ m_maincpu(*this, "maincpu"),
+ m_dac(*this, "dac"){ }
optional_device<tlc34076_device> m_tlc34076;
required_shared_ptr<UINT16> m_vram_base;
@@ -64,4 +66,5 @@ public:
TIMER_CALLBACK_MEMBER(deferred_iop_w);
TIMER_DEVICE_CALLBACK_MEMBER(nvram_write_timeout);
TIMER_DEVICE_CALLBACK_MEMBER(amerdart_audio_int_gen);
+ required_device<dac_device> m_dac;
};
diff --git a/src/mame/includes/cosmic.h b/src/mame/includes/cosmic.h
index 4419dc30f5d..90cfa2af290 100644
--- a/src/mame/includes/cosmic.h
+++ b/src/mame/includes/cosmic.h
@@ -18,6 +18,7 @@ public:
: driver_device(mconfig, type, tag),
m_videoram(*this, "videoram"),
m_spriteram(*this, "spriteram"),
+ m_dac(*this, "dac"),
m_maincpu(*this, "maincpu") { }
/* memory pointers */
@@ -41,7 +42,7 @@ public:
/* devices */
samples_device *m_samples;
- dac_device *m_dac;
+ required_device<dac_device> m_dac;
DECLARE_WRITE8_MEMBER(panic_sound_output_w);
DECLARE_WRITE8_MEMBER(panic_sound_output2_w);
DECLARE_WRITE8_MEMBER(cosmicg_output_w);
diff --git a/src/mame/includes/cvs.h b/src/mame/includes/cvs.h
index 1dd65bb1dda..ead3c8e50e2 100644
--- a/src/mame/includes/cvs.h
+++ b/src/mame/includes/cvs.h
@@ -27,7 +27,9 @@ public:
m_tms5110_ctl_data(*this, "tms5110_ctl"),
m_dac3_state(*this, "dac3_state"),
m_maincpu(*this, "maincpu"),
- m_audiocpu(*this, "audiocpu") { }
+ m_audiocpu(*this, "audiocpu"),
+ m_dac2(*this, "dac2"),
+ m_dac3(*this, "dac3") { }
/* memory pointers */
required_shared_ptr<UINT8> m_video_ram;
@@ -60,7 +62,8 @@ public:
required_device<cpu_device> m_maincpu;
optional_device<cpu_device> m_audiocpu;
device_t *m_speech;
- dac_device *m_dac3;
+ optional_device<dac_device> m_dac2;
+ optional_device<dac_device> m_dac3;
device_t *m_tms;
device_t *m_s2636_0;
device_t *m_s2636_1;
diff --git a/src/mame/includes/equites.h b/src/mame/includes/equites.h
index 03214dc34d1..26506e44bb4 100644
--- a/src/mame/includes/equites.h
+++ b/src/mame/includes/equites.h
@@ -16,6 +16,8 @@ public:
m_spriteram_2(*this, "spriteram_2"),
m_mcu_ram(*this, "mcu_ram"),
m_mcu(*this, "mcu"),
+ m_dac_1(*this, "dac1"),
+ m_dac_2(*this, "dac2"),
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu") { }
@@ -59,8 +61,8 @@ public:
/* devices */
optional_device<cpu_device> m_mcu;
msm5232_device *m_msm;
- dac_device *m_dac_1;
- dac_device *m_dac_2;
+ required_device<dac_device> m_dac_1;
+ required_device<dac_device> m_dac_2;
DECLARE_WRITE8_MEMBER(equites_c0f8_w);
DECLARE_WRITE8_MEMBER(equites_cymbal_ctrl_w);
DECLARE_WRITE8_MEMBER(equites_dac_latch_w);
diff --git a/src/mame/includes/esripsys.h b/src/mame/includes/esripsys.h
index dc47fafafd3..496f0b0043c 100644
--- a/src/mame/includes/esripsys.h
+++ b/src/mame/includes/esripsys.h
@@ -10,6 +10,7 @@
#pragma once
#include "cpu/esrip/esrip.h"
+#include "sound/dac.h"
/* TODO */
#define ESRIPSYS_PIXEL_CLOCK (XTAL_25MHz / 2)
@@ -40,7 +41,8 @@ public:
m_gamecpu(*this, "game_cpu"),
m_soundcpu(*this, "sound_cpu"),
m_tms(*this, "tms5220nl"),
- m_pal_ram(*this, "pal_ram") { }
+ m_pal_ram(*this, "pal_ram"),
+ m_dac(*this, "dac") { }
required_device<cpu_device> m_framecpu;
required_device<esrip_device> m_videocpu;
@@ -115,6 +117,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;
};
diff --git a/src/mame/includes/exterm.h b/src/mame/includes/exterm.h
index 47b551e8ba7..aee8e62aace 100644
--- a/src/mame/includes/exterm.h
+++ b/src/mame/includes/exterm.h
@@ -3,6 +3,7 @@
Gottlieb Exterminator hardware
*************************************************************************/
+#include "sound/dac.h"
class exterm_state : public driver_device
{
@@ -13,7 +14,8 @@ public:
m_slave_videoram(*this, "slave_videoram"),
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
- m_slave(*this, "slave") { }
+ m_slave(*this, "slave"),
+ m_dac(*this, "dac") { }
UINT8 m_aimpos[2];
UINT8 m_trackball_old[2];
@@ -43,6 +45,7 @@ public:
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
required_device<cpu_device> m_slave;
+ required_device<dac_device> m_dac;
};
/*----------- defined in video/exterm.c -----------*/
diff --git a/src/mame/includes/galaxian.h b/src/mame/includes/galaxian.h
index e1cde0a782a..378dfa2bc01 100644
--- a/src/mame/includes/galaxian.h
+++ b/src/mame/includes/galaxian.h
@@ -5,6 +5,7 @@
***************************************************************************/
#include "machine/i8255.h"
+#include "sound/dac.h"
/* we scale horizontally by 3 to render stars correctly */
#define GALAXIAN_XSCALE 3
@@ -39,7 +40,8 @@ public:
m_spriteram(*this, "spriteram"),
m_videoram(*this, "videoram"),
m_maincpu(*this, "maincpu"),
- m_audiocpu(*this, "audiocpu") { }
+ m_audiocpu(*this, "audiocpu"),
+ m_dac(*this, "dac") { }
optional_device<i8255_device> m_ppi8255_0;
optional_device<i8255_device> m_ppi8255_1;
@@ -288,4 +290,5 @@ public:
galaxian_extend_tile_info_func extend_tile_info,galaxian_extend_sprite_info_func extend_sprite_info);
required_device<cpu_device> m_maincpu;
optional_device<cpu_device> m_audiocpu;
+ optional_device<dac_device> m_dac;
};
diff --git a/src/mame/includes/harddriv.h b/src/mame/includes/harddriv.h
index ba3a0046e2e..17697dd8896 100644
--- a/src/mame/includes/harddriv.h
+++ b/src/mame/includes/harddriv.h
@@ -45,7 +45,8 @@ public:
m_gsp_paletteram_lo(*this, "gsp_palram_lo"),
m_gsp_paletteram_hi(*this, "gsp_palram_hi"),
m_ds3sdsp_internal_timer(*this, "ds3sdsp_timer"),
- m_ds3xdsp_internal_timer(*this, "ds3xdsp_timer") { }
+ m_ds3xdsp_internal_timer(*this, "ds3xdsp_timer"),
+ m_dac(*this, "dac") { }
required_device<cpu_device> m_maincpu;
required_device<tms34010_device> m_gsp;
@@ -259,6 +260,7 @@ public:
TIMER_CALLBACK_MEMBER(deferred_adsp_bank_switch);
TIMER_CALLBACK_MEMBER(rddsp32_sync_cb);
DECLARE_WRITE16_MEMBER(hdsnddsp_dac_w);
+ optional_device<dac_device> m_dac;
};
diff --git a/src/mame/includes/homedata.h b/src/mame/includes/homedata.h
index 19b714d2a76..9d90050316a 100644
--- a/src/mame/includes/homedata.h
+++ b/src/mame/includes/homedata.h
@@ -9,7 +9,8 @@ public:
m_vreg(*this, "vreg"),
m_videoram(*this, "videoram"),
m_maincpu(*this, "maincpu"),
- m_audiocpu(*this, "audiocpu") {}
+ m_audiocpu(*this, "audiocpu"),
+ m_dac(*this, "dac") {}
/* memory pointers */
optional_shared_ptr<UINT8> m_vreg;
@@ -40,7 +41,7 @@ public:
/* device */
required_device<cpu_device> m_maincpu;
optional_device<cpu_device> m_audiocpu;
- dac_device *m_dac;
+ optional_device<dac_device> m_dac;
device_t *m_ym;
sn76489a_device *m_sn;
UINT8 m_prot_data;
diff --git a/src/mame/includes/m72.h b/src/mame/includes/m72.h
index 5c72232abe1..a07e950474d 100644
--- a/src/mame/includes/m72.h
+++ b/src/mame/includes/m72.h
@@ -3,6 +3,7 @@
Irem M72 hardware
*************************************************************************/
+#include "sound/dac.h"
class m72_state : public driver_device
{
@@ -17,7 +18,8 @@ public:
m_soundram(*this, "soundram"),
m_maincpu(*this, "maincpu"),
m_soundcpu(*this, "soundcpu"),
- m_mcu(*this, "mcu") { }
+ m_mcu(*this, "mcu"),
+ m_dac(*this, "dac") { }
required_shared_ptr<UINT16> m_spriteram;
required_shared_ptr<UINT16> m_videoram1;
@@ -138,4 +140,5 @@ 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;
};
diff --git a/src/mame/includes/mappy.h b/src/mame/includes/mappy.h
index ed73bbfb9ab..06dc10e55e0 100644
--- a/src/mame/includes/mappy.h
+++ b/src/mame/includes/mappy.h
@@ -1,3 +1,5 @@
+#include "sound/dac.h"
+
class mappy_state : public driver_device
{
public:
@@ -7,7 +9,8 @@ public:
m_spriteram(*this, "spriteram"),
m_maincpu(*this, "maincpu"),
m_subcpu(*this, "sub"),
- m_subcpu2(*this, "sub2") { }
+ m_subcpu2(*this, "sub2"),
+ m_dac(*this, "dac") { }
required_shared_ptr<UINT8> m_videoram;
required_shared_ptr<UINT8> m_spriteram;
@@ -69,5 +72,6 @@ public:
void phozon_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT8 *spriteram_base);
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_subcpu;
- required_device<cpu_device> m_subcpu2;
+ optional_device<cpu_device> m_subcpu2;
+ optional_device<dac_device> m_dac;
};
diff --git a/src/mame/includes/n8080.h b/src/mame/includes/n8080.h
index 86e3d598c75..b60d49d8807 100644
--- a/src/mame/includes/n8080.h
+++ b/src/mame/includes/n8080.h
@@ -1,3 +1,4 @@
+#include "sound/dac.h"
class n8080_state : public driver_device
{
@@ -6,7 +7,8 @@ public:
: driver_device(mconfig, type, tag),
m_videoram(*this, "videoram"),
m_colorram(*this, "colorram"),
- m_maincpu(*this, "maincpu"){ }
+ m_maincpu(*this, "maincpu"),
+ m_dac(*this, "dac") { }
/* memory pointers */
required_shared_ptr<UINT8> m_videoram;
@@ -89,6 +91,7 @@ public:
TIMER_DEVICE_CALLBACK_MEMBER(helifire_dac_volume_timer);
void spacefev_start_red_cannon( );
void helifire_next_line( );
+ required_device<dac_device> m_dac;
};
/*----------- defined in audio/n8080.c -----------*/
diff --git a/src/mame/includes/nbmj9195.h b/src/mame/includes/nbmj9195.h
index 4b1c866d60b..099996445b7 100644
--- a/src/mame/includes/nbmj9195.h
+++ b/src/mame/includes/nbmj9195.h
@@ -1,3 +1,5 @@
+#include "sound/dac.h"
+
#define VRAM_MAX 2
#define SCANLINE_MIN 0
@@ -9,7 +11,9 @@ class nbmj9195_state : public driver_device
public:
nbmj9195_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag) ,
- m_maincpu(*this, "maincpu") { }
+ m_maincpu(*this, "maincpu"),
+ m_dac1(*this, "dac1"),
+ m_dac2(*this, "dac2") { }
int m_inputport;
int m_dipswbitsel;
@@ -127,4 +131,6 @@ public:
void nbmj9195_dipswbitsel_w(int data);
void mscoutm_inputportsel_w(int data);
required_device<cpu_device> m_maincpu;
+ required_device<dac_device> m_dac1;
+ required_device<dac_device> m_dac2;
};
diff --git a/src/mame/includes/niyanpai.h b/src/mame/includes/niyanpai.h
index e5728548700..2ed83cfd6bc 100644
--- a/src/mame/includes/niyanpai.h
+++ b/src/mame/includes/niyanpai.h
@@ -1,3 +1,4 @@
+#include "sound/dac.h"
#define VRAM_MAX 3
class niyanpai_state : public driver_device
@@ -5,7 +6,9 @@ class niyanpai_state : public driver_device
public:
niyanpai_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag) ,
- m_maincpu(*this, "maincpu") { }
+ m_maincpu(*this, "maincpu"),
+ m_dac1(*this, "dac1"),
+ m_dac2(*this, "dac2") { }
int m_musobana_inputport;
int m_musobana_outcoin_flag;
@@ -92,4 +95,6 @@ public:
void niyanpai_gfxdraw(int vram);
void niyanpai_soundbank_w(int data);
required_device<cpu_device> m_maincpu;
+ required_device<dac_device> m_dac1;
+ required_device<dac_device> m_dac2;
};
diff --git a/src/mame/includes/rltennis.h b/src/mame/includes/rltennis.h
index 003ba9292b9..5dfed21d6e8 100644
--- a/src/mame/includes/rltennis.h
+++ b/src/mame/includes/rltennis.h
@@ -11,7 +11,9 @@ public:
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
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){ }
+ m_offset_shift(0),
+ m_dac_1(*this, "dac1"),
+ m_dac_2(*this, "dac2") { }
required_device<cpu_device> m_maincpu;
device_t *m_screen;
@@ -30,8 +32,8 @@ public:
bitmap_ind16 *m_tmp_bitmap[RLT_NUM_BITMAPS];
- dac_device *m_dac_1;
- dac_device *m_dac_2;
+ required_device<dac_device> m_dac_1;
+ required_device<dac_device> m_dac_2;
UINT8 *m_samples_1;
UINT8 *m_samples_2;
diff --git a/src/mame/includes/segas24.h b/src/mame/includes/segas24.h
index 6558feae4cb..912fa54cfb9 100644
--- a/src/mame/includes/segas24.h
+++ b/src/mame/includes/segas24.h
@@ -1,4 +1,5 @@
#include "video/segaic24.h"
+#include "sound/dac.h"
class segas24_state : public driver_device
{
@@ -6,7 +7,8 @@ public:
segas24_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag) ,
m_maincpu(*this, "maincpu"),
- m_subcpu(*this, "subcpu") { }
+ m_subcpu(*this, "subcpu"),
+ m_dac(*this, "dac") { }
static const UINT8 mahmajn_mlt[8];
@@ -122,4 +124,5 @@ public:
TIMER_DEVICE_CALLBACK_MEMBER(irq_vbl);
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_subcpu;
+ required_device<dac_device> m_dac;
};
diff --git a/src/mame/includes/suna16.h b/src/mame/includes/suna16.h
index cb540ee191e..b21359f10a8 100644
--- a/src/mame/includes/suna16.h
+++ b/src/mame/includes/suna16.h
@@ -1,3 +1,5 @@
+#include "sound/dac.h"
+
class suna16_state : public driver_device
{
public:
@@ -5,13 +7,20 @@ public:
: driver_device(mconfig, type, tag),
m_maincpu(*this,"maincpu"),
m_spriteram(*this, "spriteram"),
- m_spriteram2(*this, "spriteram2")
+ m_spriteram2(*this, "spriteram2"),
+ m_dac1(*this, "dac1"),
+ m_dac2(*this, "dac2"),
+ m_dac3(*this, "dac3"),
+ m_dac4(*this, "dac4")
{ }
required_device<cpu_device> m_maincpu;
required_shared_ptr<UINT16> m_spriteram;
optional_shared_ptr<UINT16> m_spriteram2;
-
+ required_device<dac_device> m_dac1;
+ required_device<dac_device> m_dac2;
+ optional_device<dac_device> m_dac3;
+ optional_device<dac_device> m_dac4;
UINT8 m_prot;
UINT16 *m_paletteram;
int m_color_bank;
diff --git a/src/mame/includes/taitosj.h b/src/mame/includes/taitosj.h
index 68e262c490b..2e11bb9f711 100644
--- a/src/mame/includes/taitosj.h
+++ b/src/mame/includes/taitosj.h
@@ -1,3 +1,5 @@
+#include "sound/dac.h"
+
class taitosj_state : public driver_device
{
public:
@@ -19,7 +21,8 @@ public:
m_kikstart_scrollram(*this, "kikstart_scroll"),
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
- m_mcu(*this, "mcu") { }
+ m_mcu(*this, "mcu"),
+ m_dac(*this, "dac") { }
typedef void (taitosj_state::*copy_layer_func_t)(bitmap_ind16 &,
const rectangle &, int, int *, rectangle *);
@@ -120,4 +123,5 @@ 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;
};
diff --git a/src/mame/includes/tatsumi.h b/src/mame/includes/tatsumi.h
index 8eaa81bf0f6..c9a36058fac 100644
--- a/src/mame/includes/tatsumi.h
+++ b/src/mame/includes/tatsumi.h
@@ -137,7 +137,7 @@ public:
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
required_device<cpu_device> m_subcpu;
- required_device<cpu_device> m_subcpu2;
+ optional_device<cpu_device> m_subcpu2;
required_device<okim6295_device> m_oki;
};
diff --git a/src/mame/includes/tceptor.h b/src/mame/includes/tceptor.h
index 75788092975..b175c53e24d 100644
--- a/src/mame/includes/tceptor.h
+++ b/src/mame/includes/tceptor.h
@@ -1,4 +1,5 @@
#include "namcos2.h"
+#include "sound/dac.h"
class tceptor_state : public driver_device
{
@@ -11,7 +12,8 @@ public:
m_m68k_shared_ram(*this, "m68k_shared_ram"),
m_sprite_ram(*this, "sprite_ram"),
m_c45_road(*this, "c45_road") ,
- m_maincpu(*this, "maincpu") { }
+ m_maincpu(*this, "maincpu"),
+ m_dac(*this, "dac") { }
UINT8 m_m6809_irq_enable;
UINT8 m_m68k_irq_enable;
@@ -77,4 +79,5 @@ public:
inline UINT8 fix_input0(UINT8 in1, UINT8 in2);
inline UINT8 fix_input1(UINT8 in1, UINT8 in2);
required_device<cpu_device> m_maincpu;
+ required_device<dac_device> m_dac;
};
diff --git a/src/mame/includes/tnzs.h b/src/mame/includes/tnzs.h
index 5da8d39a07e..7cbfa46a1f5 100644
--- a/src/mame/includes/tnzs.h
+++ b/src/mame/includes/tnzs.h
@@ -1,3 +1,4 @@
+#include "sound/dac.h"
#define MAX_SAMPLES 0x2f /* max samples */
@@ -23,7 +24,8 @@ public:
m_audiocpu(*this, "audiocpu"),
m_subcpu(*this, "sub"),
m_mcu(*this, "mcu"),
- m_maincpu(*this, "maincpu") { }
+ m_maincpu(*this, "maincpu"),
+ m_dac(*this, "dac") { }
/* memory pointers */
// UINT8 * m_paletteram; // currently this uses generic palette handling
@@ -109,4 +111,5 @@ public:
void mcu_handle_coins( int coin );
DECLARE_WRITE_LINE_MEMBER(irqhandler);
required_device<cpu_device> m_maincpu;
+ optional_device<dac_device> m_dac;
};
diff --git a/src/mame/includes/truco.h b/src/mame/includes/truco.h
index 8168fc357c5..164d027eb2a 100644
--- a/src/mame/includes/truco.h
+++ b/src/mame/includes/truco.h
@@ -1,3 +1,5 @@
+#include "sound/dac.h"
+
class truco_state : public driver_device
{
public:
@@ -5,7 +7,8 @@ public:
: driver_device(mconfig, type, tag),
m_videoram(*this, "videoram"),
m_battery_ram(*this, "battery_ram"),
- m_maincpu(*this, "maincpu") { }
+ m_maincpu(*this, "maincpu"),
+ m_dac(*this, "dac") { }
required_shared_ptr<UINT8> m_videoram;
required_shared_ptr<UINT8> m_battery_ram;
@@ -20,4 +23,5 @@ public:
UINT32 screen_update_truco(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(truco_interrupt);
required_device<cpu_device> m_maincpu;
+ required_device<dac_device> m_dac;
};
diff --git a/src/mame/includes/trucocl.h b/src/mame/includes/trucocl.h
index 31ee8a7c580..fd4b23667b0 100644
--- a/src/mame/includes/trucocl.h
+++ b/src/mame/includes/trucocl.h
@@ -1,3 +1,5 @@
+#include "sound/dac.h"
+
class trucocl_state : public driver_device
{
public:
@@ -5,7 +7,8 @@ public:
: driver_device(mconfig, type, tag),
m_videoram(*this, "videoram"),
m_colorram(*this, "colorram"),
- m_maincpu(*this, "maincpu") { }
+ m_maincpu(*this, "maincpu"),
+ m_dac(*this, "dac") { }
int m_cur_dac_address;
int m_cur_dac_address_index;
@@ -26,4 +29,5 @@ public:
INTERRUPT_GEN_MEMBER(trucocl_interrupt);
TIMER_CALLBACK_MEMBER(dac_irq);
required_device<cpu_device> m_maincpu;
+ required_device<dac_device> m_dac;
};
diff --git a/src/mame/includes/zaccaria.h b/src/mame/includes/zaccaria.h
index 891bcb80244..b2809953ac0 100644
--- a/src/mame/includes/zaccaria.h
+++ b/src/mame/includes/zaccaria.h
@@ -1,3 +1,5 @@
+#include "sound/dac.h"
+
class zaccaria_state : public driver_device
{
public:
@@ -8,7 +10,8 @@ public:
m_spriteram(*this, "spriteram"),
m_spriteram2(*this, "spriteram2"),
m_maincpu(*this, "maincpu"),
- m_audiocpu(*this, "audiocpu") { }
+ m_audiocpu(*this, "audiocpu"),
+ m_dac2(*this, "dac2") { }
int m_dsw;
int m_active_8910;
@@ -52,4 +55,5 @@ public:
void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect,UINT8 *spriteram,int color,int section);
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
+ required_device<dac_device> m_dac2;
};
diff --git a/src/mess/drivers/a310.c b/src/mess/drivers/a310.c
index a08391f93b5..5b20a636deb 100644
--- a/src/mess/drivers/a310.c
+++ b/src/mess/drivers/a310.c
@@ -131,7 +131,7 @@ void a310_state::machine_start()
archimedes_init();
// reset the DAC to centerline
- //machine().device<dac_device>("dac")->write_signed8(0x80);
+ //m_dac->write_signed8(0x80);
}
void a310_state::machine_reset()
diff --git a/src/mess/drivers/craft.c b/src/mess/drivers/craft.c
index 1d6136abd66..3964a9e1054 100644
--- a/src/mess/drivers/craft.c
+++ b/src/mess/drivers/craft.c
@@ -230,8 +230,6 @@ DRIVER_INIT_MEMBER(craft_state,craft)
void craft_state::machine_reset()
{
- m_dac = machine().device<dac_device>("dac");
-
m_dac->write_unsigned8(0x00);
m_frame_start_cycle = 0;
diff --git a/src/mess/drivers/dectalk.c b/src/mess/drivers/dectalk.c
index 22a41f04463..01fe39966de 100644
--- a/src/mess/drivers/dectalk.c
+++ b/src/mess/drivers/dectalk.c
@@ -235,8 +235,9 @@ class dectalk_state : public driver_device
public:
dectalk_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
- m_terminal(*this, TERMINAL_TAG) ,
- m_maincpu(*this, "maincpu") { }
+ m_terminal(*this, TERMINAL_TAG) ,
+ m_maincpu(*this, "maincpu"),
+ m_dac(*this, "dac") { }
UINT8 m_data[8]; // hack to prevent gcc bitching about struct pointers. not used.
UINT8 m_x2214_sram[256]; // NVRAM chip's temp sram space
@@ -285,6 +286,7 @@ public:
void dectalk_semaphore_w ( UINT16 data );
UINT16 dectalk_outfifo_r ( );
required_device<cpu_device> m_maincpu;
+ required_device<dac_device> m_dac;
};
@@ -783,13 +785,12 @@ INPUT_PORTS_END
TIMER_CALLBACK_MEMBER(dectalk_state::outfifo_read_cb)
{
UINT16 data;
- dac_device *speaker = machine().device<dac_device>("dac");
data = dectalk_outfifo_r();
#ifdef VERBOSE
if (data!= 0x8000) logerror("sample output: %04X\n", data);
#endif
machine().scheduler().timer_set(attotime::from_hz(10000), timer_expired_delegate(FUNC(dectalk_state::outfifo_read_cb),this));
- speaker->write_signed16(data);
+ m_dac->write_signed16(data);
// 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("duart68681");
diff --git a/src/mess/drivers/pockstat.c b/src/mess/drivers/pockstat.c
index 16f7bcd606a..31321eda505 100644
--- a/src/mess/drivers/pockstat.c
+++ b/src/mess/drivers/pockstat.c
@@ -93,7 +93,8 @@ public:
pockstat_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_lcd_buffer(*this, "lcd_buffer"),
- m_maincpu(*this, "maincpu") { }
+ m_maincpu(*this, "maincpu"),
+ m_dac(*this, "dac") { }
required_shared_ptr<UINT32> m_lcd_buffer;
ps_ftlb_regs_t m_ftlb_regs;
@@ -133,6 +134,7 @@ public:
void ps_intc_set_interrupt_line(UINT32 line, int state);
void ps_timer_start(int index);
required_device<cpu_device> m_maincpu;
+ required_device<dac_device> m_dac;
};
@@ -818,7 +820,7 @@ WRITE32_MEMBER(pockstat_state::ps_audio_w)
WRITE32_MEMBER(pockstat_state::ps_dac_w)
{
- machine().device<dac_device>("dac")->write_unsigned16((UINT16)((data + 0x8000) & 0x0000ffff));
+ m_dac->write_unsigned16((UINT16)((data + 0x8000) & 0x0000ffff));
}
static ADDRESS_MAP_START(pockstat_mem, AS_PROGRAM, 32, pockstat_state )
diff --git a/src/mess/includes/hp48.h b/src/mess/includes/hp48.h
index 1a5ddaafc27..8514f545c9c 100644
--- a/src/mess/includes/hp48.h
+++ b/src/mess/includes/hp48.h
@@ -9,7 +9,7 @@
#ifdef CHARDEV
#include "devices/chardev.h"
#endif
-
+#include "sound/dac.h"
/* model */
enum hp48_models {
HP48_S,
@@ -45,7 +45,8 @@ class hp48_state : public driver_device
public:
hp48_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
- m_maincpu(*this, "maincpu") { }
+ m_maincpu(*this, "maincpu"),
+ m_dac(*this, "dac") { }
UINT8 *m_videoram;
UINT8 m_io[64];
@@ -88,6 +89,7 @@ public:
void hp48_update_annunciators();
void hp48_apply_modules();
required_device<cpu_device> m_maincpu;
+ required_device<dac_device> m_dac;
};
diff --git a/src/mess/includes/orao.h b/src/mess/includes/orao.h
index 6e83076dde8..6bfcfd9dbae 100644
--- a/src/mess/includes/orao.h
+++ b/src/mess/includes/orao.h
@@ -6,7 +6,7 @@
#ifndef ORAO_H_
#define ORAO_H_
-
+#include "sound/dac.h"
class orao_state : public driver_device
{
@@ -15,7 +15,8 @@ public:
: driver_device(mconfig, type, tag),
m_memory(*this, "memory"),
m_video_ram(*this, "video_ram"),
- m_maincpu(*this, "maincpu") { }
+ m_maincpu(*this, "maincpu"),
+ m_dac(*this, "dac") { }
required_shared_ptr<UINT8> m_memory;
required_shared_ptr<UINT8> m_video_ram;
@@ -27,6 +28,7 @@ public:
virtual void video_start();
UINT32 screen_update_orao(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
required_device<cpu_device> m_maincpu;
+ required_device<dac_device> m_dac;
};
#endif /* ORAO_H_ */
diff --git a/src/mess/machine/hp48.c b/src/mess/machine/hp48.c
index c88e7c68654..0980d5cae50 100644
--- a/src/mess/machine/hp48.c
+++ b/src/mess/machine/hp48.c
@@ -246,7 +246,7 @@ void hp48_reg_out( device_t *device, int out )
/* bits 9-10: unused */
/* bit 11: beeper */
- device->machine().device<dac_device>("dac")->write_unsigned8((out & 0x800) ? 0x80 : 00 );
+ state->m_dac->write_unsigned8((out & 0x800) ? 0x80 : 00 );
}
static int hp48_get_in( running_machine &machine )
diff --git a/src/mess/machine/orao.c b/src/mess/machine/orao.c
index eaa89dcb8e1..7bdd8d801ff 100644
--- a/src/mess/machine/orao.c
+++ b/src/mess/machine/orao.c
@@ -72,7 +72,6 @@ WRITE8_MEMBER(orao_state::orao_io_w)
{
if (offset == 0x0800)
{
- dac_device *dac = machine().device<dac_device>("dac");
- dac->write_unsigned8(data); //beeper
+ m_dac->write_unsigned8(data); //beeper
}
}