1 // license:BSD-3-Clause
2 // copyright-holders:Couriersud
3 /***************************************************************************
4 
5     Irem M52/M62 sound hardware
6 
7 ***************************************************************************/
8 
9 #include "emu.h"
10 #include "audio/irem.h"
11 
12 #include "cpu/m6800/m6801.h"
13 #include "sound/discrete.h"
14 #include "speaker.h"
15 
16 
17 DEFINE_DEVICE_TYPE(IREM_M62_AUDIO,        m62_audio_device,        "m62_audio",        "Irem M62 Audio")
18 DEFINE_DEVICE_TYPE(IREM_M52_SOUNDC_AUDIO, m52_soundc_audio_device, "m52_soundc_audio", "Irem M52 SoundC Audio")
19 DEFINE_DEVICE_TYPE(IREM_M52_LARGE_AUDIO,  m52_large_audio_device,  "m52_large_audio",  "Irem M52 Large Audio")
20 
irem_audio_device(const machine_config & mconfig,device_type type,const char * tag,device_t * owner,uint32_t clock)21 irem_audio_device::irem_audio_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
22 	: device_t(mconfig, type, tag, owner, clock)
23 	, m_audio_SINH(*this, "snd_nl:sinh")
24 	, m_cpu(*this, "iremsound")
25 	, m_adpcm1(*this, "msm1")
26 	, m_adpcm2(*this, "msm2")
27 	, m_ay_45L(*this, "ay_45l")
28 	, m_ay_45M(*this, "ay_45m")
29 	, m_port1(0)
30 	, m_port2(0)
31 	, m_soundlatch(0)
32 	, m_audio_BD(*this, "snd_nl:ibd")
33 	, m_audio_SD(*this, "snd_nl:isd")
34 	, m_audio_OH(*this, "snd_nl:ioh")
35 	, m_audio_CH(*this, "snd_nl:ich")
36 {
37 }
38 
m62_audio_device(const machine_config & mconfig,const char * tag,device_t * owner,uint32_t clock)39 m62_audio_device::m62_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
40 	: irem_audio_device(mconfig, IREM_M62_AUDIO, tag, owner, clock)
41 {
42 }
43 
m52_soundc_audio_device(const machine_config & mconfig,const char * tag,device_t * owner,uint32_t clock)44 m52_soundc_audio_device::m52_soundc_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
45 	: irem_audio_device(mconfig, IREM_M52_SOUNDC_AUDIO, tag, owner, clock)
46 {
47 }
48 
m52_large_audio_device(const machine_config & mconfig,const char * tag,device_t * owner,uint32_t clock)49 m52_large_audio_device::m52_large_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
50 	: irem_audio_device(mconfig, IREM_M52_LARGE_AUDIO, tag, owner, clock)
51 {
52 }
53 
54 //-------------------------------------------------
55 //  device_start - device-specific startup
56 //-------------------------------------------------
57 
device_start()58 void irem_audio_device::device_start()
59 {
60 	save_item(NAME(m_port1));
61 	save_item(NAME(m_port2));
62 	save_item(NAME(m_soundlatch));
63 }
64 
65 //-------------------------------------------------
66 //  device_reset - device-specific reset
67 //-------------------------------------------------
68 
device_reset()69 void irem_audio_device::device_reset()
70 {
71 	m_port1 = 0; // ?
72 	m_port2 = 0; // ?
73 	m_soundlatch = 0;
74 	m_cpu->set_input_line(0, ASSERT_LINE);
75 }
76 
77 /*************************************
78  *
79  *  External writes to the sound
80  *  command register
81  *
82  *************************************/
83 
cmd_w(uint8_t data)84 void irem_audio_device::cmd_w(uint8_t data)
85 {
86 	m_soundlatch = data;
87 	if ((data & 0x80) == 0)
88 		m_cpu->set_input_line(0, ASSERT_LINE);
89 }
90 
91 
92 /*************************************
93  *
94  *  Sound latch read
95  *
96  *************************************/
97 
soundlatch_r()98 uint8_t irem_audio_device::soundlatch_r()
99 {
100 	return m_soundlatch;
101 }
102 
103 /*************************************
104  *
105  *  6803 output ports
106  *
107  *************************************/
108 
m6803_port1_w(uint8_t data)109 void irem_audio_device::m6803_port1_w(uint8_t data)
110 {
111 	m_port1 = data;
112 }
113 
114 
m6803_port2_w(uint8_t data)115 void irem_audio_device::m6803_port2_w(uint8_t data)
116 {
117 	/* write latch */
118 	if ((m_port2 & 0x01) && !(data & 0x01))
119 	{
120 		/* control or data port? */
121 		if (m_port2 & 0x04)
122 		{
123 			/* PSG 0 or 1? */
124 			if (m_port2 & 0x08)
125 				m_ay_45M->address_w(m_port1);
126 			if (m_port2 & 0x10)
127 				m_ay_45L->address_w(m_port1);
128 		}
129 		else
130 		{
131 			/* PSG 0 or 1? */
132 			if (m_port2 & 0x08)
133 				m_ay_45M->data_w(m_port1);
134 			if (m_port2 & 0x10)
135 				m_ay_45L->data_w(m_port1);
136 		}
137 	}
138 	m_port2 = data;
139 }
140 
141 
142 
143 /*************************************
144  *
145  *  6803 input ports
146  *
147  *************************************/
148 
m6803_port1_r()149 uint8_t irem_audio_device::m6803_port1_r()
150 {
151 	/* PSG 0 or 1? */
152 	if (m_port2 & 0x08)
153 		return m_ay_45M->data_r();
154 	if (m_port2 & 0x10)
155 		return m_ay_45L->data_r();
156 	return 0xff;
157 }
158 
159 
m6803_port2_r()160 uint8_t irem_audio_device::m6803_port2_r()
161 {
162 	/*
163 	 * Pin21, 6803 (Port 21) tied with 4.7k to +5V
164 	 *
165 	 */
166 	//printf("port2 read\n"); // used by 10yard
167 	return 0x0;
168 }
169 
170 
171 
172 /*************************************
173  *
174  *  AY-8910 output ports
175  *
176  *************************************/
177 
ay8910_45M_portb_w(uint8_t data)178 void irem_audio_device::ay8910_45M_portb_w(uint8_t data)
179 {
180 	/* bits 2-4 select MSM5205 clock & 3b/4b playback mode */
181 	m_adpcm1->playmode_w((data >> 2) & 7);
182 	if (m_adpcm2 != nullptr)
183 		m_adpcm2->playmode_w(((data >> 2) & 4) | 3); /* always in slave mode */
184 
185 	/* bits 0 and 1 reset the two chips */
186 	m_adpcm1->reset_w(data & 1);
187 	if (m_adpcm2 != nullptr)
188 		m_adpcm2->reset_w(data & 2);
189 }
190 
191 
ay8910_45L_porta_w(uint8_t data)192 void irem_audio_device::ay8910_45L_porta_w(uint8_t data)
193 {
194 	/*
195 	 *  45L 21 IOA0  ==> BD
196 	 *  45L 20 IOA1  ==> SD
197 	 *  45L 19 IOA2  ==> OH
198 	 *  45L 18 IOA3  ==> CH
199 	 *
200 	 */
201 	if (m_audio_BD) m_audio_BD->write_line(data & 0x01 ? 1: 0);
202 	if (m_audio_SD) m_audio_SD->write_line(data & 0x02 ? 1: 0);
203 	if (m_audio_OH) m_audio_OH->write_line(data & 0x04 ? 1: 0);
204 	if (m_audio_CH) m_audio_CH->write_line(data & 0x08 ? 1: 0);
205 #ifdef MAME_DEBUG
206 	if (data & 0x0f) popmessage("analog sound %x",data&0x0f);
207 #endif
208 }
209 
210 
211 
212 /*************************************
213  *
214  *  Memory-mapped accesses
215  *
216  *************************************/
217 
sound_irq_ack_w(uint8_t data)218 void irem_audio_device::sound_irq_ack_w(uint8_t data)
219 {
220 	if ((m_soundlatch & 0x80) != 0)
221 		m_cpu->set_input_line(0, CLEAR_LINE);
222 }
223 
224 
m52_adpcm_w(offs_t offset,uint8_t data)225 void irem_audio_device::m52_adpcm_w(offs_t offset, uint8_t data)
226 {
227 	if (offset & 1)
228 	{
229 		m_adpcm1->data_w(data);
230 	}
231 	if (offset & 2)
232 	{
233 		if (m_adpcm2 != nullptr)
234 			m_adpcm2->data_w(data);
235 	}
236 }
237 
238 
m62_adpcm_w(offs_t offset,uint8_t data)239 void irem_audio_device::m62_adpcm_w(offs_t offset, uint8_t data)
240 {
241 	msm5205_device *adpcm = (offset & 1) ? m_adpcm2.target() : m_adpcm1.target();
242 	if (adpcm != nullptr)
243 		adpcm->data_w(data);
244 }
245 
246 
247 
248 /*************************************
249  *
250  *  Sound interfaces
251  *
252  *************************************/
253 
254 /* All 6 (3*2) AY-3-8910 outputs are tied together
255  * and put with 470 Ohm to gnd.
256  * The following is a approximation, since
257  * it does not take cross-chip mixing effects into account.
258  */
259 
260 
261 /*
262  * http://newsgroups.derkeiler.com/Archive/Rec/rec.games.video.arcade.collecting/2006-06/msg03108.html
263  *
264  * mentions, that moon patrol does work on moon ranger hardware.
265  * There is no MSM5250, but a 74LS00 producing white noise for explosions
266  */
267 
268 /* Certain values are different from schematics
269  * I did my test to verify against pcb pictures of "tropical angel"
270  */
271 
272 #define M52_R9      560
273 #define M52_R10     330
274 #define M52_R12     RES_K(10)
275 #define M52_R13     RES_K(10)
276 #define M52_R14     RES_K(10)
277 #define M52_R15     RES_K(2.2)  /* schematics RES_K(22) , althought 10-Yard states 2.2 */
278 #define M52_R19     RES_K(10)
279 #define M52_R22     RES_K(47)
280 #define M52_R23     RES_K(2.2)
281 #define M52_R25     RES_K(10)
282 #define M52_VR1     RES_K(50)
283 
284 #define M52_C28     CAP_U(1)
285 #define M52_C30     CAP_U(0.022)
286 #define M52_C32     CAP_U(0.022)
287 #define M52_C35     CAP_U(47)
288 #define M52_C37     CAP_U(0.1)
289 #define M52_C38     CAP_U(0.0068)
290 
291 /*
292  * C35 is disabled, the mixer would just deliver
293  * no signals if it is enabled.
294  * TODO: Check discrete mixer
295  *
296  */
297 
298 static const discrete_mixer_desc m52_sound_c_stage1 =
299 	{DISC_MIXER_IS_RESISTOR,
300 		{M52_R19, M52_R22, M52_R23 },
301 		{      0,       0,       0 },   /* variable resistors   */
302 		{M52_C37,       0,       0 },   /* node capacitors      */
303 				0,      0,              /* rI, rF               */
304 		M52_C35*0,                      /* cF                   */
305 		0,                              /* cAmp                 */
306 		0, 1};
307 
308 static const discrete_op_amp_filt_info m52_sound_c_sallen_key =
309 	{ M52_R13, M52_R14, 0, 0, 0,
310 		M52_C32, M52_C38, 0
311 	};
312 
313 static const discrete_mixer_desc m52_sound_c_mix1 =
314 	{DISC_MIXER_IS_RESISTOR,
315 		{M52_R25, M52_R15 },
316 		{      0,       0 },    /* variable resistors   */
317 		{      0,       0 },    /* node capacitors      */
318 				0, M52_VR1,     /* rI, rF               */
319 		0,                      /* cF                   */
320 		CAP_U(1),               /* cAmp                 */
321 		0, 1};
322 
323 static DISCRETE_SOUND_START( m52_sound_c_discrete )
324 
325 	/* Chip AY8910/1 */
326 	DISCRETE_INPUTX_STREAM(NODE_01, 0, 1.0, 0)
327 	/* Chip AY8910/2 */
328 	DISCRETE_INPUTX_STREAM(NODE_02, 1, 1.0, 0)
329 	/* Chip MSM5250 */
330 	DISCRETE_INPUTX_STREAM(NODE_03, 2, 1.0, 0)
331 
332 	/* Just mix the two AY8910s */
333 	DISCRETE_ADDER2(NODE_09, 1, NODE_01, NODE_02)
334 	DISCRETE_DIVIDE(NODE_10, 1, NODE_09, 2.0)
335 
336 	/* Mix in 5 V to MSM5250 signal */
337 	DISCRETE_MIXER3(NODE_20, 1, NODE_03, 32767.0, 0, &m52_sound_c_stage1)
338 
339 	/* Sallen - Key Filter */
340 	/* TODO: R12, C30: This looks like a band pass */
DISCRETE_RCFILTER(NODE_25,NODE_20,M52_R12,M52_C30)341 	DISCRETE_RCFILTER(NODE_25, NODE_20, M52_R12, M52_C30)
342 	DISCRETE_SALLEN_KEY_FILTER(NODE_30, 1, NODE_25, DISC_SALLEN_KEY_LOW_PASS, &m52_sound_c_sallen_key)
343 
344 	/* Mix signals */
345 	DISCRETE_MIXER2(NODE_40, 1, NODE_10, NODE_25, &m52_sound_c_mix1)
346 	DISCRETE_CRFILTER(NODE_45, NODE_40, M52_R10+M52_R9, M52_C28)
347 
348 	DISCRETE_OUTPUT(NODE_40, 18.0)
349 
350 DISCRETE_SOUND_END
351 
352 /*************************************
353  *
354  *  Address maps
355  *
356  *************************************/
357 
358 /* complete address map verified from Moon Patrol/10 Yard Fight schematics */
359 /* large map uses 8k ROMs, small map uses 4k ROMs; this is selected via a jumper */
360 void irem_audio_device::m52_small_sound_map(address_map &map)
361 {
362 	map.global_mask(0x7fff);
363 	map(0x0000, 0x0fff).w(FUNC(irem_audio_device::m52_adpcm_w));
364 	map(0x1000, 0x1fff).w(FUNC(irem_audio_device::sound_irq_ack_w));
365 	map(0x2000, 0x7fff).rom();
366 }
367 
m52_large_sound_map(address_map & map)368 void irem_audio_device::m52_large_sound_map(address_map &map)
369 {
370 	map(0x0000, 0x1fff).w(FUNC(irem_audio_device::m52_adpcm_w));
371 	map(0x2000, 0x3fff).w(FUNC(irem_audio_device::sound_irq_ack_w));
372 	map(0x4000, 0xffff).rom();
373 }
374 
375 
376 /* complete address map verified from Kid Niki schematics */
m62_sound_map(address_map & map)377 void irem_audio_device::m62_sound_map(address_map &map)
378 {
379 	map(0x0800, 0x0800).mirror(0xf7fc).w(FUNC(irem_audio_device::sound_irq_ack_w));
380 	map(0x0801, 0x0802).mirror(0xf7fc).w(FUNC(irem_audio_device::m62_adpcm_w));
381 	map(0x4000, 0xffff).rom();
382 }
383 
384 
385 /*
386  * Original recordings:
387  *
388  * https://www.youtube.com/watch?v=Hr1wZpwP7R4
389  *
390  * This is not an original recording ("drums added")
391  *
392  * https://www.youtube.com/watch?v=aarl0xfBQf0
393  *
394  */
395 
396 //-------------------------------------------------
397 // device_add_mconfig - add device configuration
398 //-------------------------------------------------
399 
device_add_mconfig(machine_config & config)400 void m62_audio_device::device_add_mconfig(machine_config &config)
401 {
402 	/* basic machine hardware */
403 	m6803_cpu_device &cpu(M6803(config, m_cpu, XTAL(3'579'545))); /* verified on pcb */
404 	cpu.set_addrmap(AS_PROGRAM, &m62_audio_device::m62_sound_map);
405 	cpu.in_p1_cb().set(FUNC(m62_audio_device::m6803_port1_r));
406 	cpu.out_p1_cb().set(FUNC(m62_audio_device::m6803_port1_w));
407 	cpu.in_p2_cb().set(FUNC(m62_audio_device::m6803_port2_r));
408 	cpu.out_p2_cb().set(FUNC(m62_audio_device::m6803_port2_w));
409 
410 	/* sound hardware */
411 	SPEAKER(config, "mono").front_center();
412 
413 	AY8910(config, m_ay_45M, XTAL(3'579'545)/4); /* verified on pcb */
414 	m_ay_45M->set_flags(AY8910_RESISTOR_OUTPUT);
415 	m_ay_45M->set_resistors_load(2000.0, 2000.0, 2000.0);
416 	m_ay_45M->port_a_read_callback().set(FUNC(irem_audio_device::soundlatch_r));
417 	m_ay_45M->port_b_write_callback().set(FUNC(irem_audio_device::ay8910_45M_portb_w));
418 	m_ay_45M->add_route(0, "snd_nl", 1.0, 0);
419 	m_ay_45M->add_route(1, "snd_nl", 1.0, 1);
420 	m_ay_45M->add_route(2, "snd_nl", 1.0, 2);
421 
422 	AY8910(config, m_ay_45L, XTAL(3'579'545)/4); /* verified on pcb */
423 	m_ay_45L->set_flags(AY8910_RESISTOR_OUTPUT);
424 	m_ay_45L->set_resistors_load(2000.0, 2000.0, 2000.0);
425 	m_ay_45L->port_a_write_callback().set(FUNC(irem_audio_device::ay8910_45L_porta_w));
426 	m_ay_45L->add_route(0, "snd_nl", 1.0, 3);
427 	m_ay_45L->add_route(1, "snd_nl", 1.0, 4);
428 	m_ay_45L->add_route(2, "snd_nl", 1.0, 5);
429 
430 	MSM5205(config, m_adpcm1, 384_kHz_XTAL); // verified on PCB
431 	m_adpcm1->vck_callback().set_inputline(m_cpu, INPUT_LINE_NMI); // driven through NPN inverter
432 	m_adpcm1->vck_callback().append(m_adpcm2, FUNC(msm5205_device::vclk_w)); // the first MSM5205 clocks the second
433 	m_adpcm1->set_prescaler_selector(msm5205_device::S96_4B); // default to 4KHz, but can be changed at run time
434 	m_adpcm1->add_route(0, "snd_nl", 1.0, 6);
435 
436 	MSM5205(config, m_adpcm2, 384_kHz_XTAL); // verified on PCB
437 	m_adpcm2->set_prescaler_selector(msm5205_device::SEX_4B); // default to 4KHz, but can be changed at run time, slave
438 	m_adpcm2->add_route(0, "snd_nl", 1.0, 7);
439 
440 	/* NETLIST configuration using internal AY8910 resistor values */
441 
442 	NETLIST_SOUND(config, "snd_nl", 48000)
443 		.set_source(netlist_kidniki)
444 		.add_route(ALL_OUTPUTS, "mono", 1.0);
445 
446 	NETLIST_LOGIC_INPUT(config, "snd_nl:ibd", "I_BD0.IN", 0);
447 	NETLIST_LOGIC_INPUT(config, "snd_nl:isd", "I_SD0.IN", 0);
448 	NETLIST_LOGIC_INPUT(config, "snd_nl:ich", "I_CH0.IN", 0);
449 	NETLIST_LOGIC_INPUT(config, "snd_nl:ioh", "I_OH0.IN", 0);
450 	NETLIST_LOGIC_INPUT(config, "snd_nl:sinh", "SINH.IN", 0);
451 
452 	NETLIST_STREAM_INPUT(config, "snd_nl:cin0", 0, "R_AY45M_A.R");
453 	NETLIST_STREAM_INPUT(config, "snd_nl:cin1", 1, "R_AY45M_B.R");
454 	NETLIST_STREAM_INPUT(config, "snd_nl:cin2", 2, "R_AY45M_C.R");
455 
456 	NETLIST_STREAM_INPUT(config, "snd_nl:cin3", 3, "R_AY45L_A.R");
457 	NETLIST_STREAM_INPUT(config, "snd_nl:cin4", 4, "R_AY45L_B.R");
458 	NETLIST_STREAM_INPUT(config, "snd_nl:cin5", 5, "R_AY45L_C.R");
459 
460 	NETLIST_STREAM_INPUT(config, "snd_nl:cin6", 6, "I_MSM2K0.IN").set_mult_offset(10.0, 2.5);
461 	NETLIST_STREAM_INPUT(config, "snd_nl:cin7", 7, "I_MSM3K0.IN").set_mult_offset(10.0, 2.5);
462 
463 	NETLIST_STREAM_OUTPUT(config, "snd_nl:cout0", 0, "R26.1").set_mult_offset(30000.0 * 10.0 / 32768.0, 0.0);
464 }
465 
device_add_mconfig(machine_config & config)466 void m52_soundc_audio_device::device_add_mconfig(machine_config &config)
467 {
468 	/* basic machine hardware */
469 	m6803_cpu_device &cpu(M6803(config, m_cpu, XTAL(3'579'545))); /* verified on pcb */
470 	cpu.set_addrmap(AS_PROGRAM, &m52_soundc_audio_device::m52_small_sound_map);
471 	cpu.in_p1_cb().set(FUNC(m52_soundc_audio_device::m6803_port1_r));
472 	cpu.out_p1_cb().set(FUNC(m52_soundc_audio_device::m6803_port1_w));
473 	cpu.in_p2_cb().set(FUNC(m52_soundc_audio_device::m6803_port2_r));
474 	cpu.out_p2_cb().set(FUNC(m52_soundc_audio_device::m6803_port2_w));
475 
476 	/* sound hardware */
477 	SPEAKER(config, "mono").front_center();
478 
479 	AY8910(config, m_ay_45M, XTAL(3'579'545)/4); /* verified on pcb */
480 	m_ay_45M->set_flags(AY8910_SINGLE_OUTPUT | AY8910_DISCRETE_OUTPUT);
481 	m_ay_45M->set_resistors_load(470, 0, 0);
482 	m_ay_45M->port_a_read_callback().set(FUNC(irem_audio_device::soundlatch_r));
483 	m_ay_45M->port_b_write_callback().set(FUNC(irem_audio_device::ay8910_45M_portb_w));
484 	m_ay_45M->add_route(0, "filtermix", 1.0, 0);
485 
486 	AY8910(config, m_ay_45L, XTAL(3'579'545)/4); /* verified on pcb */
487 	m_ay_45L->set_flags(AY8910_SINGLE_OUTPUT | AY8910_DISCRETE_OUTPUT);
488 	m_ay_45L->set_resistors_load(470, 0, 0);
489 	m_ay_45L->port_a_write_callback().set(FUNC(irem_audio_device::ay8910_45L_porta_w));
490 	m_ay_45L->add_route(0, "filtermix", 1.0, 1);
491 
492 	MSM5205(config, m_adpcm1, XTAL(384'000)); /* verified on pcb */
493 	m_adpcm1->vck_callback().set_inputline(m_cpu, INPUT_LINE_NMI); // driven through NPN inverter
494 	m_adpcm1->set_prescaler_selector(msm5205_device::S96_4B);      /* default to 4KHz, but can be changed at run time */
495 	m_adpcm1->add_route(0, "filtermix", 1.0, 2);
496 
497 	DISCRETE(config, "filtermix", m52_sound_c_discrete).add_route(ALL_OUTPUTS, "mono", 1.0);
498 }
499 
device_add_mconfig(machine_config & config)500 void m52_large_audio_device::device_add_mconfig(machine_config &config)  /* 10 yard fight */
501 {
502 	/* basic machine hardware */
503 	m6803_cpu_device &cpu(M6803(config, m_cpu, XTAL(3'579'545))); /* verified on pcb */
504 	cpu.set_addrmap(AS_PROGRAM, &m52_large_audio_device::m52_large_sound_map);
505 	cpu.in_p1_cb().set(FUNC(m52_large_audio_device::m6803_port1_r));
506 	cpu.out_p1_cb().set(FUNC(m52_large_audio_device::m6803_port1_w));
507 	cpu.in_p2_cb().set(FUNC(m52_large_audio_device::m6803_port2_r));
508 	cpu.out_p2_cb().set(FUNC(m52_large_audio_device::m6803_port2_w));
509 
510 	/* sound hardware */
511 	SPEAKER(config, "mono").front_center();
512 
513 	AY8910(config, m_ay_45M, XTAL(3'579'545)/4); /* verified on pcb */
514 	m_ay_45M->set_flags(AY8910_SINGLE_OUTPUT | AY8910_DISCRETE_OUTPUT);
515 	m_ay_45M->set_resistors_load(470, 0, 0);
516 	m_ay_45M->port_a_read_callback().set(FUNC(irem_audio_device::soundlatch_r));
517 	m_ay_45M->port_b_write_callback().set(FUNC(irem_audio_device::ay8910_45M_portb_w));
518 	m_ay_45M->add_route(ALL_OUTPUTS, "mono", 0.80);
519 
520 	AY8910(config, m_ay_45L, XTAL(3'579'545)/4); /* verified on pcb */
521 	m_ay_45L->set_flags(AY8910_SINGLE_OUTPUT | AY8910_DISCRETE_OUTPUT);
522 	m_ay_45L->set_resistors_load(470, 0, 0);
523 	m_ay_45L->port_a_write_callback().set(FUNC(irem_audio_device::ay8910_45L_porta_w));
524 	m_ay_45L->add_route(ALL_OUTPUTS, "mono", 0.80);
525 
526 	MSM5205(config, m_adpcm1, 384_kHz_XTAL); // verified on PCB
527 	m_adpcm1->vck_callback().set_inputline(m_cpu, INPUT_LINE_NMI); // driven through NPN inverter
528 	m_adpcm1->vck_callback().append(m_adpcm2, FUNC(msm5205_device::vclk_w)); // the first MSM5205 clocks the second
529 	m_adpcm1->set_prescaler_selector(msm5205_device::S96_4B); // default to 4KHz, but can be changed at run time
530 	m_adpcm1->add_route(ALL_OUTPUTS, "mono", 0.80);
531 
532 	MSM5205(config, m_adpcm2, 384_kHz_XTAL); // verified on PCB
533 	m_adpcm2->set_prescaler_selector(msm5205_device::SEX_4B); // default to 4KHz, but can be changed at run time, slave
534 	m_adpcm2->add_route(ALL_OUTPUTS, "mono", 0.80);
535 }
536