summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/1942.c
diff options
context:
space:
mode:
author Couriersud <couriersud@users.noreply.github.com>2014-02-04 23:39:21 +0000
committer Couriersud <couriersud@users.noreply.github.com>2014-02-04 23:39:21 +0000
commit6b6bd02db188a3459ea2a87465c3e1d6454469fe (patch)
treec298aed0d0bd1f47ff26daadd828e276860a14b1 /src/mame/drivers/1942.c
parent35c7cf0381a3d748111ece399976a8e20b00ea46 (diff)
Added netlist output stage to 1942
This is disabled by default for now. Once the stream input/output interface settled it will be enabled. Those who like to try it NOW: Set at the top of 1942.c #define USE_NETLIST (1) I think the quality is better with netlist. Better dynamics, you can hear the rotors now. I have observed no performance impact as well.
Diffstat (limited to 'src/mame/drivers/1942.c')
-rw-r--r--src/mame/drivers/1942.c125
1 files changed, 124 insertions, 1 deletions
diff --git a/src/mame/drivers/1942.c b/src/mame/drivers/1942.c
index b8459cea6f3..cee3e936616 100644
--- a/src/mame/drivers/1942.c
+++ b/src/mame/drivers/1942.c
@@ -63,11 +63,105 @@ correctly.
#define SOUND_CPU_CLOCK (XTAL_12MHz/4) /* 12MHz is the only OSC on the PCB */
#define AUDIO_CLOCK (XTAL_12MHz/8) /* 12MHz is the only OSC on the PCB */
+#define USE_NETLIST (0)
+
#include "emu.h"
#include "cpu/z80/z80.h"
#include "sound/ay8910.h"
#include "includes/1942.h"
+#if USE_NETLIST
+#include "machine/netlist.h"
+#include "netlist/devices/net_lib.h"
+#endif
+
+
+
+#if USE_NETLIST
+
+#define NLFILT(RA, R1, C1, R2) \
+ NET_C(RA.1, V5) \
+ NET_C(RA.2, R1.1) \
+ NET_C(R1.2, GND) \
+ NET_C(R1.1, C1.1) \
+ NET_C(C1.2, R2.1)
+
+static NETLIST_START(nl_1942)
+
+ /* Standard stuff */
+
+ SOLVER(Solver)
+ PARAM(Solver.FREQ, 48000)
+ ANALOG_INPUT(V5, 5)
+
+ NETDEV_SOUND_IN(SND_IN)
+ PARAM(SND_IN.CHAN0, "R_AY1_1.R")
+ PARAM(SND_IN.CHAN1, "R_AY1_2.R")
+ PARAM(SND_IN.CHAN2, "R_AY1_3.R")
+ PARAM(SND_IN.CHAN3, "R_AY2_1.R")
+ PARAM(SND_IN.CHAN4, "R_AY2_2.R")
+ PARAM(SND_IN.CHAN5, "R_AY2_3.R")
+
+ /* AY 8910 internal resistors */
+
+ RES(R_AY1_1, 1000);
+ RES(R_AY1_2, 1000);
+ RES(R_AY1_3, 1000);
+ RES(R_AY2_1, 1000);
+ RES(R_AY2_2, 1000);
+ RES(R_AY2_3, 1000);
+
+ RES(R2, 220000)
+ RES(R3, 220000)
+ RES(R4, 220000)
+ RES(R5, 220000)
+ RES(R6, 220000)
+ RES(R7, 220000)
+
+ RES(R11, 10000)
+ RES(R12, 10000)
+ RES(R13, 10000)
+ RES(R14, 10000)
+ RES(R15, 10000)
+ RES(R16, 10000)
+
+ CAP(CC7, 10e-6)
+ CAP(CC8, 10e-6)
+ CAP(CC9, 10e-6)
+ CAP(CC10, 10e-6)
+ CAP(CC11, 10e-6)
+ CAP(CC12, 10e-6)
+
+ NLFILT(R_AY2_3, R13, CC7, R2)
+ NLFILT(R_AY2_2, R15, CC8, R3)
+ NLFILT(R_AY2_1, R11, CC9, R4)
+
+ NLFILT(R_AY1_3, R12, CC10, R5)
+ NLFILT(R_AY1_2, R14, CC11, R6)
+ NLFILT(R_AY1_1, R16, CC12, R7)
+
+ POT(VR, 2000)
+ NET_C(VR.3, GND)
+
+ NET_C(R2.2, VR.1)
+ NET_C(R3.2, VR.1)
+ NET_C(R4.2, VR.1)
+ NET_C(R5.2, VR.1)
+ NET_C(R6.2, VR.1)
+ NET_C(R7.2, VR.1)
+
+ CAP(CC6, 10e-6)
+ RES(R1, 100000)
+
+ NET_C(CC6.1, VR.2)
+ NET_C(CC6.2, R1.1)
+ NET_C(R1.2, GND)
+
+ NETDEV_SOUND_OUT(CH0, 0, 100000)
+ NET_C(CH0.IN, R1.1)
+
+NETLIST_END()
+#endif
WRITE8_MEMBER(_1942_state::c1942_bankswitch_w)
{
@@ -444,6 +538,18 @@ void _1942_state::machine_reset()
m_scroll[1] = 0;
}
+#if USE_NETLIST
+static const ay8910_interface ay8910_config =
+{
+ AY8910_RESISTOR_OUTPUT,
+ AY8910_DEFAULT_LOADS,
+ DEVCB_NULL,
+ DEVCB_NULL,
+ DEVCB_NULL,
+ DEVCB_NULL
+};
+#endif
+
static MACHINE_CONFIG_START( 1942, _1942_state )
/* basic machine hardware */
@@ -470,11 +576,28 @@ static MACHINE_CONFIG_START( 1942, _1942_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
-
+#if USE_NETLIST
+ MCFG_SOUND_ADD("ay1", AY8910, AUDIO_CLOCK) /* 1.5 MHz */
+ MCFG_SOUND_CONFIG(ay8910_config)
+ MCFG_SOUND_ROUTE_EX(0, "snd_nl", 1.0, 0)
+ MCFG_SOUND_ROUTE_EX(1, "snd_nl", 1.0, 1)
+ MCFG_SOUND_ROUTE_EX(2, "snd_nl", 1.0, 2)
+ MCFG_SOUND_ADD("ay2", AY8910, AUDIO_CLOCK) /* 1.5 MHz */
+ MCFG_SOUND_CONFIG(ay8910_config)
+ MCFG_SOUND_ROUTE_EX(0, "snd_nl", 1.0, 3)
+ MCFG_SOUND_ROUTE_EX(1, "snd_nl", 1.0, 4)
+ MCFG_SOUND_ROUTE_EX(2, "snd_nl", 1.0, 5)
+
+ MCFG_SOUND_ADD("snd_nl", NETLIST_SOUND, 48000)
+ MCFG_NETLIST_SETUP(nl_1942)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 5.0)
+
+#else
MCFG_SOUND_ADD("ay1", AY8910, AUDIO_CLOCK) /* 1.5 MHz */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
MCFG_SOUND_ADD("ay2", AY8910, AUDIO_CLOCK) /* 1.5 MHz */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+#endif
MACHINE_CONFIG_END