summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Couriersud <couriersud@users.noreply.github.com>2008-04-25 23:51:15 +0000
committer Couriersud <couriersud@users.noreply.github.com>2008-04-25 23:51:15 +0000
commit5ac45d5a80db47633f326dc880640378bebbd037 (patch)
treee5f5b04a29b4d3d084b89383a2172c7b7f6ff622
parent7590822c236983eea9eccaf55aace9156064ed57 (diff)
Added discrete mixing and filtering to irem games using m52-sound-c boards: mpatrol, travrusa
-rw-r--r--src/mame/audio/irem.c144
-rw-r--r--src/mame/audio/irem.h2
-rw-r--r--src/mame/drivers/m52.c2
-rw-r--r--src/mame/drivers/m57.c2
-rw-r--r--src/mame/drivers/travrusa.c2
5 files changed, 133 insertions, 19 deletions
diff --git a/src/mame/audio/irem.c b/src/mame/audio/irem.c
index d41b4d2d4e0..005017e0e9a 100644
--- a/src/mame/audio/irem.c
+++ b/src/mame/audio/irem.c
@@ -10,6 +10,7 @@
#include "cpu/m6800/m6800.h"
#include "sound/ay8910.h"
#include "sound/msm5205.h"
+#include "sound/discrete.h"
static UINT8 port1, port2;
@@ -120,11 +121,13 @@ static WRITE8_HANDLER( ay8910_0_portb_w )
{
/* bits 2-4 select MSM5205 clock & 3b/4b playback mode */
MSM5205_playmode_w(0, (data >> 2) & 7);
- MSM5205_playmode_w(1, ((data >> 2) & 4) | 3); /* always in slave mode */
+ if (sndti_exists(SOUND_MSM5205, 1))
+ MSM5205_playmode_w(1, ((data >> 2) & 4) | 3); /* always in slave mode */
/* bits 0 and 1 reset the two chips */
MSM5205_reset_w(0, data & 1);
- MSM5205_reset_w(1, data & 2);
+ if (sndti_exists(SOUND_MSM5205, 1))
+ MSM5205_reset_w(1, data & 2);
}
@@ -153,7 +156,7 @@ static WRITE8_HANDLER( m52_adpcm_w )
{
if (offset & 1)
MSM5205_data_w(0, data);
- if (offset & 2)
+ if ((offset & 2) && sndti_exists(SOUND_MSM5205, 1))
MSM5205_data_w(1, data);
}
@@ -176,8 +179,11 @@ static void adpcm_int(int data)
cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE);
/* the first MSM5205 clocks the second */
- MSM5205_vclk_w(1,1);
- MSM5205_vclk_w(1,0);
+ if (sndti_exists(SOUND_MSM5205, 1))
+ {
+ MSM5205_vclk_w(1,1);
+ MSM5205_vclk_w(1,0);
+ }
}
@@ -188,10 +194,14 @@ static void adpcm_int(int data)
*
*************************************/
+/* All 6 (3*2) AY-3-8910 outputs are tied together
+ * and put with 470 KOhm to gnd.
+ * The following is a approximation */
+
static const struct AY8910interface irem_ay8910_interface_1 =
{
- AY8910_LEGACY_OUTPUT,
- AY8910_DEFAULT_LOADS,
+ AY8910_SINGLE_OUTPUT,
+ {470, 0, 0},
soundlatch_r,
NULL,
NULL,
@@ -200,8 +210,8 @@ static const struct AY8910interface irem_ay8910_interface_1 =
static const struct AY8910interface irem_ay8910_interface_2 =
{
- AY8910_LEGACY_OUTPUT,
- AY8910_DEFAULT_LOADS,
+ AY8910_SINGLE_OUTPUT,
+ {470, 0, 0},
NULL,
NULL,
ay8910_1_porta_w,
@@ -220,7 +230,91 @@ static const struct MSM5205interface irem_msm5205_interface_2 =
MSM5205_SEX_4B /* default to 4KHz, but can be changed at run time, slave */
};
-
+/*
+ * http://newsgroups.derkeiler.com/Archive/Rec/rec.games.video.arcade.collecting/2006-06/msg03108.html
+ *
+ * mentions, that moon patrol does work on moon ranger hardware.
+ * There is no MSM5250, but a 74LS00 producing white noise for explosions
+ */
+
+/* Certain values are different from schematics
+ * I did my test to verify against pcb pictures of "tropical angel"
+ */
+
+#define M52_R12 RES_K(10)
+#define M52_R13 RES_K(10)
+#define M52_R14 RES_K(10)
+#define M52_R15 RES_K(2.2) /* schematics RES_K(22) */
+#define M52_R19 RES_K(10)
+#define M52_R22 RES_K(4.7) /* schematics RES_K(47) */
+#define M52_R23 RES_K(2.2)
+#define M52_R25 RES_K(10)
+#define M52_VR1 RES_K(50)
+
+#define M52_C30 CAP_U(0.022)
+#define M52_C32 CAP_U(0.022)
+#define M52_C35 CAP_U(47)
+#define M52_C37 CAP_U(0.1)
+#define M52_C38 CAP_U(0.0068)
+
+/*
+ * C35 is disabled, the mixer would just deliver
+ * no signals if it is enabled.
+ * TODO: Check discrete mixer
+ *
+ */
+
+static const discrete_mixer_desc m52_sound_c_stage1 =
+ {DISC_MIXER_IS_RESISTOR,
+ {M52_R19, M52_R22 },
+ { 0, 0 }, /* variable resistors */
+ {M52_C37, 0 }, /* node capacitors */
+ 0, M52_R23, /* rI, rF */
+ M52_C35*0, /* cF */
+ 0, /* cAmp */
+ 0, 1};
+
+static const discrete_op_amp_filt_info m52_sound_c_sallen_key =
+ { M52_R13, M52_R14, 0, 0, 0,
+ M52_C32, M52_C38, 0
+ };
+
+static const discrete_mixer_desc m52_sound_c_mix1 =
+ {DISC_MIXER_IS_RESISTOR,
+ {M52_R25, M52_R15 },
+ { 0, 0 }, /* variable resistors */
+ { 0, 0 }, /* node capacitors */
+ 0, M52_VR1, /* rI, rF */
+ 0, /* cF */
+ CAP_U(1), /* cAmp */
+ 0, 1};
+
+static DISCRETE_SOUND_START( m52_sound_c )
+
+ /* Chip AY8910/1 */
+ DISCRETE_INPUTX_STREAM(NODE_01, 0, 1.0, 0)
+ /* Chip AY8910/2 */
+ DISCRETE_INPUTX_STREAM(NODE_02, 1, 1.0, 0)
+ /* Chip MSM5250 */
+ DISCRETE_INPUTX_STREAM(NODE_03, 2, 1.0, 0)
+
+ /* Just mix the two AY8910s */
+ DISCRETE_ADDER2(NODE_09, 1, NODE_01, NODE_02)
+ DISCRETE_DIVIDE(NODE_10, 1, NODE_09, 2.0)
+
+ /* Mix in 5 V to MSM5250 signal */
+ DISCRETE_MIXER2(NODE_20, 1, NODE_03, 32767.0, &m52_sound_c_stage1)
+
+ /* Sallen - Key Filter */
+ /* TODO: R12, C30: This looks like a band pass */
+ DISCRETE_SALLEN_KEY_FILTER(NODE_30, 1, NODE_20, DISC_SALLEN_KEY_LOW_PASS, &m52_sound_c_sallen_key)
+
+ /* Mix signals */
+ DISCRETE_MIXER2(NODE_40, 1, NODE_10, NODE_30, &m52_sound_c_mix1)
+
+ DISCRETE_OUTPUT(NODE_40, 18.0)
+
+DISCRETE_SOUND_END
/*************************************
*
@@ -293,15 +387,35 @@ static MACHINE_DRIVER_START( irem_audio_base )
MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
MACHINE_DRIVER_END
+MACHINE_DRIVER_START( m52_sound_c_audio )
-MACHINE_DRIVER_START( m52_small_audio )
- MDRV_IMPORT_FROM(irem_audio_base)
-
+ MDRV_SOUND_START(irem_audio)
+
/* basic machine hardware */
- MDRV_CPU_MODIFY("iremsound")
+ MDRV_CPU_ADD_TAG("iremsound", M6803, XTAL_3_579545MHz) /* verified on pcb */
+ MDRV_CPU_IO_MAP(irem_sound_portmap,0)
MDRV_CPU_PROGRAM_MAP(m52_small_sound_map,0)
-MACHINE_DRIVER_END
+
+ /* sound hardware */
+ MDRV_SPEAKER_STANDARD_MONO("mono")
+
+ MDRV_SOUND_ADD_TAG("ay8910.0", AY8910, XTAL_3_579545MHz/4) /* verified on pcb */
+ MDRV_SOUND_CONFIG(irem_ay8910_interface_1)
+ MDRV_SOUND_ROUTE_EX(0, "filtermix", 1.0, 0)
+
+ MDRV_SOUND_ADD_TAG("ay8910.0", AY8910, XTAL_3_579545MHz/4) /* verified on pcb */
+ MDRV_SOUND_CONFIG(irem_ay8910_interface_2)
+ MDRV_SOUND_ROUTE_EX(0, "filtermix", 1.0, 1)
+
+ MDRV_SOUND_ADD_TAG("msm5250", MSM5205, XTAL_384kHz) /* verified on pcb */
+ MDRV_SOUND_CONFIG(irem_msm5205_interface_1)
+ MDRV_SOUND_ROUTE_EX(0, "filtermix", 1.0, 2)
+
+ MDRV_SOUND_ADD_TAG("filtermix", DISCRETE, 0)
+ MDRV_SOUND_CONFIG_DISCRETE(m52_sound_c)
+ MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+MACHINE_DRIVER_END
MACHINE_DRIVER_START( m52_large_audio ) /* 10 yard fight */
MDRV_IMPORT_FROM(irem_audio_base)
diff --git a/src/mame/audio/irem.h b/src/mame/audio/irem.h
index 4f1ab1fb53d..4067e030960 100644
--- a/src/mame/audio/irem.h
+++ b/src/mame/audio/irem.h
@@ -4,7 +4,7 @@
****************************************************************************/
-MACHINE_DRIVER_EXTERN( m52_small_audio );
+MACHINE_DRIVER_EXTERN( m52_sound_c_audio );
MACHINE_DRIVER_EXTERN( m52_large_audio );
MACHINE_DRIVER_EXTERN( m62_audio );
diff --git a/src/mame/drivers/m52.c b/src/mame/drivers/m52.c
index 18948a58cf7..a12b77750eb 100644
--- a/src/mame/drivers/m52.c
+++ b/src/mame/drivers/m52.c
@@ -401,7 +401,7 @@ static MACHINE_DRIVER_START( m52 )
MDRV_VIDEO_UPDATE(m52)
/* sound hardware */
- MDRV_IMPORT_FROM(m52_small_audio)
+ MDRV_IMPORT_FROM(m52_sound_c_audio)
MACHINE_DRIVER_END
diff --git a/src/mame/drivers/m57.c b/src/mame/drivers/m57.c
index 9e6ad9c721d..1f3f4a3582d 100644
--- a/src/mame/drivers/m57.c
+++ b/src/mame/drivers/m57.c
@@ -244,7 +244,7 @@ static MACHINE_DRIVER_START( m57 )
MDRV_VIDEO_UPDATE(m57)
/* sound hardware */
- MDRV_IMPORT_FROM(m52_small_audio)
+ MDRV_IMPORT_FROM(m52_sound_c_audio)
MACHINE_DRIVER_END
diff --git a/src/mame/drivers/travrusa.c b/src/mame/drivers/travrusa.c
index 7b5916e864c..6b8f9375d7c 100644
--- a/src/mame/drivers/travrusa.c
+++ b/src/mame/drivers/travrusa.c
@@ -349,7 +349,7 @@ static MACHINE_DRIVER_START( travrusa )
MDRV_VIDEO_UPDATE(travrusa)
/* sound hardware */
- MDRV_IMPORT_FROM(m52_small_audio)
+ MDRV_IMPORT_FROM(m52_sound_c_audio)
MACHINE_DRIVER_END
static MACHINE_DRIVER_START( shtrider )