summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2020-10-07 01:06:20 -0700
committer Aaron Giles <aaron@aarongiles.com>2020-10-07 01:06:20 -0700
commit4fb2dfeb6926f8c8a244915cfafde799e4495bc5 (patch)
tree53ab0c1264b5cf6db4757ac1e6c0b4dcc3fb4e9d /src/mame
parent288ca1150361d70ec0b44bf0183867530037ef9d (diff)
vicdual: Add frogs netlist. Make sound board interface more general.
Diffstat (limited to 'src/mame')
-rw-r--r--src/mame/audio/nl_frogs.cpp540
-rw-r--r--src/mame/audio/nl_frogs.h10
-rw-r--r--src/mame/audio/vicdual.cpp314
-rw-r--r--src/mame/audio/vicdual.h25
-rw-r--r--src/mame/drivers/vicdual.cpp16
-rw-r--r--src/mame/includes/vicdual.h8
-rw-r--r--src/mame/nl.lst1
7 files changed, 637 insertions, 277 deletions
diff --git a/src/mame/audio/nl_frogs.cpp b/src/mame/audio/nl_frogs.cpp
new file mode 100644
index 00000000000..127b12ee9a6
--- /dev/null
+++ b/src/mame/audio/nl_frogs.cpp
@@ -0,0 +1,540 @@
+// license:CC0
+// copyright-holders:Aaron Giles
+
+//
+// Netlist for Frogs
+//
+// Derived from the schematics in the Frogs manual.
+//
+// Known problems/issues:
+//
+// * Croak sound should have a little bit more tonality.
+//
+// * Performance work needed
+//
+
+#include "netlist/devices/net_lib.h"
+#include "nl_frogs.h"
+
+
+//
+// Optimizations
+//
+
+#define ENABLE_FRONTIERS (0)
+#define UNDERCLOCK_NOISE_GEN (1)
+
+
+
+//
+// Hacks
+//
+
+
+
+//
+// Main netlist
+//
+
+#define D_1N914(name) DIODE(name, "1N914")
+
+#define Q_2N4401(name) QBJT_EB(name, "2N4401")
+#define Q_2N4403(name) QBJT_EB(name, "2N4403")
+
+// JFET transistors not supported, but this should do the trick
+#define Q_2N4093(name) MOSFET(name, "NMOS(VTO=-1 CAPMOD=0)")
+
+#define LM741_DIP UA741_DIP8
+
+NETLIST_START(frogs)
+
+ SOLVER(Solver, 1000)
+ PARAM(Solver.DYNAMIC_TS, 1)
+ PARAM(Solver.DYNAMIC_MIN_TIMESTEP, 4e-6)
+
+ TTL_INPUT(I_SOUND_0, 0)
+ TTL_INPUT(I_SOUND_1, 0)
+ TTL_INPUT(I_SOUND_2, 0)
+ TTL_INPUT(I_SOUND_3, 0)
+ TTL_INPUT(I_SOUND_4, 0)
+ TTL_INPUT(I_SOUND_5, 0)
+ TTL_INPUT(I_SOUND_6, 0)
+ TTL_INPUT(I_SOUND_7, 0)
+
+ NET_C(GND, I_SOUND_0.GND, I_SOUND_1.GND, I_SOUND_2.GND, I_SOUND_3.GND, I_SOUND_4.GND, I_SOUND_5.GND, I_SOUND_6.GND, I_SOUND_7.GND)
+ NET_C(I_V5, I_SOUND_0.VCC, I_SOUND_1.VCC, I_SOUND_2.VCC, I_SOUND_3.VCC, I_SOUND_4.VCC, I_SOUND_5.VCC, I_SOUND_6.VCC, I_SOUND_7.VCC)
+
+ ALIAS(I_HOP, I_SOUND_0)
+ ALIAS(I_JUMP, I_SOUND_1)
+ ALIAS(I_TONGUE, I_SOUND_2)
+ ALIAS(I_CAPTURE, I_SOUND_3)
+ ALIAS(I_FLY, I_SOUND_4)
+ ALIAS(I_SPLASH, I_SOUND_7)
+
+ ANALOG_INPUT(I_V5, 5)
+ ANALOG_INPUT(I_V12, 12)
+ ANALOG_INPUT(I_VM12, -12)
+
+ RES(R1, RES_K(3.3)) // SPLASH
+ RES(R2, RES_K(3.3)) // SPLASH
+ RES(R3, RES_K(3.3)) // CAPTURE
+ RES(R4, RES_K(3.3)) // CAPTURE
+ RES(R5, RES_K(3.3)) // TONGUE
+ RES(R6, RES_K(3.3)) // TONGUE
+ RES(R7, RES_K(3.3)) // HOP
+ RES(R8, RES_K(3.3)) // HOP
+ RES(R9, RES_K(3.3)) // JUMP
+ RES(R10, RES_K(3.3)) // JUMP
+ RES(R11, RES_K(3.3)) // FLY
+ RES(R12, RES_K(10)) // FLY
+ RES(R13, RES_K(10)) // SPLASH
+ RES(R14, RES_K(4.7)) // SPLASH
+ RES(R15, RES_K(100)) // SPLASH
+ RES(R16, RES_K(4.7)) // CAPTURE
+ RES(R17, RES_K(330)) // CAPTURE
+ RES(R18, RES_K(4.7)) // TONGUE
+ RES(R19, RES_K(100)) // TONGUE
+ RES(R20, RES_K(4.7)) // HOP
+ RES(R21, RES_K(3.3)) // HOP
+ RES(R22, RES_K(4.7)) // JUMP
+ RES(R23, RES_K(150)) // JUMP
+ RES(R24, RES_K(4.7)) // FLY
+ RES(R25, RES_K(22)) // SPLASH
+ RES(R26, 51) // HOP
+ RES(R27, RES_K(10)) // FLY
+ RES(R28, RES_K(22)) // TONGUE
+ RES(R29, RES_K(100)) // TONGUE
+ RES(R30, RES_K(470)) // HOP
+ RES(R31, 220) // HOP
+ RES(R32, RES_K(33)) // HOP (mislabelled R22)
+ RES(R33, 330) // JUMP
+ RES(R34, 820) // JUMP
+ RES(R35, RES_K(100)) // FLY
+ RES(R36, RES_K(2.2)) // FLY
+ RES(R37, RES_K(2.2)) // SPLASH
+ RES(R38, RES_K(10)) // SPLASH
+ RES(R39, RES_K(10)) // SPLASH
+ RES(R40, RES_K(68)) // CAPTURE
+ RES(R41, RES_K(4.7)) // CAPTURE
+ RES(R42, RES_K(1)) // TONGUE
+ RES(R43, RES_K(82)) // HOP
+ RES(R44, RES_K(3.3)) // FLY
+ RES(R45, RES_K(100)) // FLY
+ RES(R46, RES_K(3.3)) // FLY
+ POT(R47, RES_K(50)) // SPLASH
+ RES(R48, RES_K(47)) // CAPTURE
+ RES(R49, RES_K(3.3)) // CAPTURE
+ RES(R50, RES_K(100)) // CAPTURE
+ RES(R51, RES_K(39)) // TONGUE
+ RES(R52, 51) // HOP
+ RES(R53, RES_K(62))
+ RES(R54, 470) // JUMP
+ RES(R55, RES_K(22)) // JUMP
+ RES(R56, RES_M(2.2)) // JUMP
+ RES(R57, RES_K(22))
+ RES(R58, RES_K(22))
+ RES(R59, RES_K(3.3)) // FLY
+// RES(R60, RES_K(10)) -- final amp
+ RES(R61, RES_K(100)) // SPLASH
+ RES(R62, RES_K(47)) // SPLASH
+ RES(R63, RES_K(33)) // SPLASH
+ RES(R64, RES_K(820)) // CAPTURE
+ RES(R65, RES_K(150)) // CAPTURE
+ RES(R66, 51) // CAPTURE
+ RES(R67, 51) // CAPTURE
+ RES(R68, RES_K(1)) // JUMP
+ RES(R69, RES_K(82)) // JUMP
+ RES(R70, 51) // JUMP
+ RES(R71, RES_K(4.7)) // JUMP
+ RES(R72, RES_K(27)) // FLY
+ RES(R73, RES_K(10)) // FLY
+ RES(R74, RES_K(1)) // FLY
+ RES(R75, RES_K(10)) // JUMP
+ RES(R76, RES_K(10)) // JUMP
+ RES(R77, 560) // JUMP
+ RES(R78, RES_K(10)) // JUMP
+ RES(R79, RES_K(10)) // JUMP
+ RES(R80, RES_K(39)) // FLY
+ RES(R81, RES_K(100)) // FLY
+ RES(R82, RES_K(10)) // FLY
+ RES(R83, RES_K(100)) // JUMP
+ RES(R84, RES_K(1)) // JUMP
+ RES(R85, RES_K(10)) // JUMP
+ RES(R86, RES_K(1)) // FLY
+ RES(R87, RES_K(100)) // FLY
+ RES(R88, RES_K(82)) // FLY
+ RES(R90, RES_K(56)) // MIXER
+ POT(R91, RES_K(100))
+ POT(R92, RES_M(1))
+ POT(R93, RES_M(1))
+ POT(R94, RES_M(1))
+ POT(R95, RES_M(1))
+ POT(R96, RES_K(50))
+
+// CAP(C1, CAP_U(10))
+// CAP(C2, CAP_U(10))
+ CAP(C3, CAP_U(0.047))
+ CAP(C4, CAP_U(1))
+ CAP(C5, CAP_U(1))
+ CAP(C6, CAP_U(0.1))
+ CAP(C7, CAP_U(0.1))
+ CAP(C8, CAP_U(1))
+ CAP(C9, CAP_U(0.1))
+ CAP(C10, CAP_U(0.1))
+ CAP(C11, CAP_U(0.05))
+ CAP(C12, CAP_U(0.05))
+ CAP(C13, CAP_U(0.05))
+ CAP(C14, CAP_U(0.05))
+ CAP(C15, CAP_U(0.05))
+ CAP(C16, CAP_U(0.05))
+ CAP(C17, CAP_U(0.05))
+ CAP(C18, CAP_U(0.05))
+ CAP(C19, CAP_U(0.05))
+ CAP(C20, CAP_U(0.05))
+ CAP(C21, CAP_U(0.05))
+ CAP(C22, CAP_U(2.2))
+ CAP(C23, CAP_U(10))
+ CAP(C24, CAP_U(0.1))
+ CAP(C25, CAP_U(4.7))
+ CAP(C26, CAP_U(0.05))
+ CAP(C27, CAP_U(1))
+ CAP(C28, CAP_U(0.05))
+ CAP(C29, CAP_U(0.047))
+ CAP(C30, CAP_U(10))
+ CAP(C31, CAP_U(0.47))
+ CAP(C32, CAP_U(0.47))
+ CAP(C33, CAP_U(0.05))
+// CAP(C34, CAP_U(0.05)) -- final amp
+// CAP(C35, CAP_U(0.05)) -- final amp
+ CAP(C36, CAP_U(0.05))
+ CAP(C37, CAP_U(0.05))
+ CAP(C38, CAP_U(0.05))
+ CAP(C39, CAP_U(0.1))
+ CAP(C40, CAP_U(0.1))
+ CAP(C41, CAP_U(0.05))
+ CAP(C42, CAP_U(0.05))
+ CAP(C43, CAP_U(0.05))
+ CAP(C44, CAP_U(10))
+ CAP(C45, CAP_U(0.01))
+ CAP(C46, CAP_U(0.01))
+ CAP(C47, CAP_U(1))
+ CAP(C48, CAP_U(0.05))
+ CAP(C49, CAP_U(0.1))
+ CAP(C50, CAP_U(0.01))
+ CAP(C51, CAP_U(0.01))
+ CAP(C52, CAP_U(0.1))
+ CAP(C53, CAP_U(0.05))
+ CAP(C54, CAP_U(0.01))
+ CAP(C55, CAP_U(0.05))
+ CAP(C56, CAP_U(0.05))
+ CAP(C57, CAP_U(2.2))
+// CAP(C58, CAP_U(0.1)) -- final amp
+ CAP(C59, CAP_U(0.05))
+ CAP(C60, CAP_U(0.05))
+ CAP(C61, CAP_U(0.05))
+ CAP(C62, CAP_U(0.1))
+ CAP(C63, CAP_U(0.05))
+ CAP(C64, CAP_U(0.05))
+ CAP(C65, CAP_U(0.1))
+ CAP(C66, CAP_U(2.2))
+ CAP(C67, CAP_U(0.05))
+ CAP(C68, CAP_U(0.05))
+ CAP(C69, CAP_U(0.05))
+ CAP(C70, CAP_U(0.05))
+ CAP(C71, CAP_U(0.05))
+ CAP(C72, CAP_U(1))
+ CAP(C73, CAP_U(0.047))
+ CAP(C74, CAP_U(0.05))
+
+ D_1N914(D1)
+ D_1N914(D2)
+ D_1N914(D3)
+ D_1N914(D4)
+ D_1N914(D5)
+ D_1N914(D6)
+ D_1N914(D7)
+ D_1N914(D8)
+ D_1N914(D9)
+
+ Q_2N4401(Q1)
+ Q_2N4401(Q2)
+ Q_2N4401(Q3)
+ Q_2N4401(Q4)
+ Q_2N4401(Q5)
+ Q_2N4401(Q6)
+ Q_2N4401(Q7)
+ Q_2N4403(Q8)
+ Q_2N4403(Q9)
+ Q_2N4093(Q10)
+ Q_2N4401(Q11)
+ Q_2N4401(Q12)
+ Q_2N4403(Q13)
+ Q_2N4401(Q14)
+ Q_2N4403(Q15)
+ Q_2N4401(Q16)
+ Q_2N4403(Q17)
+ Q_2N4093(Q18)
+ Q_2N4401(Q19)
+ Q_2N4401(Q20)
+ Q_2N4401(Q21)
+
+ MM5837_DIP(U1) // Noise Generator
+#if (UNDERCLOCK_NOISE_GEN)
+ PARAM(U1.FREQ, 24000)
+#endif
+ NE555_DIP(U2) // Timer
+ NE555_DIP(U3) // Timer
+ NE555_DIP(U4) // Timer
+ NE555_DIP(U5) // Timer
+ NE555_DIP(U6) // Timer
+ NE555_DIP(U7) // Timer
+ LM741_DIP(U8) // Op. Amp.
+ NE555_DIP(U9) // Timer
+ LM741_DIP(U10) // Op. Amp.
+ LM741_DIP(U11) // Op. Amp.
+ NE555_DIP(U12) // Timer
+// LM741_DIP(U13) // Op. Amp. -- final amp
+ LM741_DIP(U14) // Op. Amp.
+ NE555_DIP(U15) // Timer
+ LM741_DIP(U16) // Op. Amp.
+ LM741_DIP(U17) // Op. Amp.
+ LM741_DIP(U18) // Op. Amp.
+ NE555_DIP(U19) // Timer
+ LM741_DIP(U20) // Op. Amp.
+
+ //
+ // JUMP
+ //
+
+ NET_C(I_V12, R22.2, U6.4, U6.8, C68.2, R23.2)
+ NET_C(GND, R10.1, Q2.E, C15.1, U6.1, C7.1, R34.1, U11.3, C71.1, C70.1, R54.1, Q19.B, D7.A, R84.1, R75.1, C64.1, R77.1, U19.1, C53.1, C52.1, U16.3)
+ NET_C(I_JUMP, R9.1)
+ NET_C(R9.2, R10.2, Q2.B)
+ NET_C(Q2.C, R22.1, U6.2)
+ NET_C(C15.2, U6.5)
+ NET_C(C68.1, GND)
+ NET_C(R23.1, U6.7, U6.6, C7.2)
+ NET_C(U6.3, C22.1, R33.1)
+ NET_C(R33.2, Q8.E)
+ NET_C(Q8.B, GND)
+ NET_C(Q8.C, C44.1, R57.1)
+ NET_C(C44.2, R70.1)
+ NET_C(R57.2, R58.2, Q16.B)
+ NET_C(Q16.E, R71.2)
+ NET_C(R71.1, R58.1, R70.2, I_VM12)
+ NET_C(R34.2, C22.2, C32.1, C31.1)
+ NET_C(C32.2, R56.1, U11.2)
+ NET_C(R56.2, C31.2, U11.6, R55.1)
+ NET_C(I_V12, C70.2, U11.7)
+ NET_C(I_VM12, U11.4, C71.2)
+ NET_C(R55.2, R54.2, Q21.B)
+ NET_C(Q21.E, D7.K, Q16.C)
+ NET_C(Q19.E, Q21.C, Q20.E)
+ NET_C(Q19.C, R76.1, R85.1, U20.2)
+ NET_C(I_V12, R76.2, R78.2)
+ NET_C(R78.1, Q20.C, U20.3, R75.2)
+ NET_C(Q20.B, R84.2, R83.1)
+ NET_C(R85.2, U20.6, R79.1)
+ NET_C(I_V12, U20.7, C63.2)
+ NET_C(C63.1, GND)
+ NET_C(I_VM12, U20.4, C64.2)
+ NET_C(R83.2, C62.1)
+ NET_C(R79.2, R77.2, C54.1, C51.1)
+ NET_C(C62.2, U19.3)
+ NET_C(I_V12, U19.4, C61.2, U19.8, R68.2)
+ NET_C(C61.1, GND)
+ NET_C(C53.2, U19.5)
+ NET_C(U19.2, U19.6, R69.1, C52.2)
+ NET_C(U19.7, R69.2, R68.1)
+ NET_C(C54.2, U16.2, R53.1)
+ NET_C(R53.2, U16.6, C51.2)
+ NET_C(I_V12, U16.7, C42.2)
+ NET_C(C42.1, GND)
+ NET_C(I_VM12, U16.4, C43.2)
+ NET_C(C43.1, GND)
+ ALIAS(BOING, U16.6)
+
+ //
+ // TONGUE
+ //
+
+ NET_C(I_V12, C20.2, R18.2, U4.4, U4.8, R19.2, Q11.C, R28.2, R42.2, U15.4, U15.8, C48.2)
+ NET_C(GND, R6.1, Q4.E, C13.1, U4.1, C5.2, R51.1, C49.1, U15.1, C41.1, C48.1)
+ NET_C(I_TONGUE, R5.1)
+ NET_C(R5.2, R6.2, Q4.B)
+ NET_C(C20.1, GND)
+ NET_C(Q4.C, R18.1, U4.2)
+ NET_C(C13.2, U4.5)
+ NET_C(C5.1, U4.7, U4.6, R19.1, R29.1)
+ RES(RU4, RES_K(100)) // netlist doesn't like unconnected
+ NET_C(RU4.1, U4.3) // 555 outputs, so run it through
+ NET_C(RU4.2, GND) // a 100k resistor to ground
+ NET_C(R29.2, Q11.B)
+ NET_C(Q11.E, Q12.B)
+ NET_C(Q12.E, R51.2)
+ NET_C(Q12.C, R28.1, Q13.B)
+ NET_C(Q13.E, R42.1)
+ NET_C(Q13.C, C49.2, U15.2, U15.6, U15.7, C50.1)
+ NET_C(U15.5, C41.2)
+ RES(RU15, RES_K(100)) // netlist doesn't like unconnected
+ NET_C(RU15.1, U15.3) // 555 outputs, so run it through
+ NET_C(RU15.2, GND) // a 100k resistor to ground
+ ALIAS(ZIP, C50.2)
+
+ //
+ // HOP
+ //
+
+ NET_C(I_V12, C69.2, R20.2, U5.4, U5.8, R21.2)
+ NET_C(GND, R8.1, Q3.E, C14.1, U5.1, C6.1, C30.2, Q9.B, R52.1, U10.3)
+ NET_C(I_HOP, R7.1)
+ NET_C(R7.2, R8.2, Q3.B)
+ NET_C(C69.1, GND)
+ NET_C(Q3.C, R20.1, U5.2)
+ NET_C(U5.5, C14.2)
+ NET_C(R21.1, U5.6, U5.7, C6.2)
+ NET_C(U5.3, D2.A, R31.1)
+ NET_C(D2.K, R32.2, C30.1)
+ NET_C(R32.1, Q9.E)
+ NET_C(Q9.C, C72.1, R43.2, Q10.G)
+ NET_C(C72.2, R26.2)
+ NET_C(I_VM12, R26.1, R43.1)
+ NET_C(R31.2, Q10.D, C29.1, C73.1)
+ NET_C(Q10.S, R52.2)
+ NET_C(C29.2, U10.2, R30.1)
+ NET_C(C73.2, R30.2, U10.6)
+ NET_C(I_V12, U10.7, C28.2)
+ NET_C(I_VM12, U10.4, C21.2)
+ NET_C(C21.1, GND)
+ NET_C(C28.1, GND)
+ ALIAS(HOP, U10.6)
+
+ //
+ // CAPTURE
+ //
+
+ NET_C(I_V12, R16.2, C18.2, U3.4, U3.8, R17.2, C74.2, U9.8, R41.2)
+ NET_C(GND, R4.1, Q5.E, C12.1, U3.1, C4.2, C19.1, U9.1, C27.2, R65.1, Q17.B, R66.1, U8.3, C18.1)
+ NET_C(I_CAPTURE, R3.1)
+ NET_C(R3.2, R4.2, Q5.B)
+ NET_C(Q5.C, R16.1, U3.2)
+ NET_C(U3.5, C12.2)
+ NET_C(R17.1, U3.6, U3.7, C4.1)
+ NET_C(U3.3, U9.4)
+ NET_C(C74.1, GND)
+ NET_C(C19.2, U9.5)
+ NET_C(R41.1, R48.2, D4.A, U9.7)
+ NET_C(U9.2, U9.6, R48.1, D4.K, C27.1)
+ NET_C(U9.3, R50.2, R49.1)
+ NET_C(R65.2, R64.2, C47.1, Q17.C, Q18.G)
+ NET_C(I_VM12, R64.1, R67.1)
+ NET_C(R67.2, C47.2)
+ NET_C(R50.1, Q17.E)
+ NET_C(R49.2, Q18.D, C39.1, C40.1)
+ NET_C(Q18.S, R66.2)
+ NET_C(C39.2, R40.1, U8.2)
+ NET_C(C40.2, R40.2, U8.6)
+ NET_C(I_V12, U8.7, C38.2)
+ NET_C(C38.1, GND)
+ NET_C(I_VM12, U8.4, C26.2)
+ NET_C(C26.1, GND)
+ ALIAS(CROAK, U8.6)
+
+ //
+ // SPLASH
+ //
+
+ NET_C(I_V12, R14.2, C17.2, U2.4, U2.8, R15.2, C25.1, R47.3, Q15.E, U1.4)
+ NET_C(GND, R2.1, Q6.E, C11.1, U2.1, C3.1, R38.1, Q14.E, U1.1, R62.1, R63.1, C37.1)
+ NET_C(I_SPLASH, R1.1)
+ NET_C(R1.2, R2.2, Q6.B)
+ NET_C(Q6.C, R14.1, U2.2)
+ NET_C(U2.5, C11.2)
+ NET_C(C17.1, GND)
+ NET_C(U2.6, U2.7, R15.1, C3.2)
+ NET_C(U2.3, R39.1)
+ NET_C(R39.2, R38.2, Q14.B)
+ NET_C(Q14.C, R37.1)
+ NET_C(R37.2, C25.2, R47.1, R25.1)
+ NET_C(R25.2, C10.1, R13.2, C9.1)
+ NET_C(Q15.C, C10.2)
+ NET_C(R13.1, D1.K)
+ NET_C(D1.A, D5.K)
+ NET_C(D5.A, U1.3)
+ NET_C(U1.2, I_VM12)
+ NET_C(C9.2, R63.2, U14.3)
+ NET_C(R62.2, U14.2, R61.1)
+ NET_C(R61.2, U14.6)
+ NET_C(I_V12, U14.7, C36.2)
+ NET_C(C36.1, GND)
+ NET_C(I_VM12, C37.2, U14.4)
+ ALIAS(SPLASH, U14.6)
+
+ //
+ // FLY
+ //
+
+ NET_C(I_V12, R12.2, R24.2, C67.2, U7.8, R35.2, C33.2, U12.8, R44.2, U17.7, C55.2, R87.2)
+ NET_C(GND, R11.1, C16.1, U7.1, C8.2, Q7.E, C23.2, U12.1, C24.1, R72.1, C56.1, R74.1, R88.1, C66.2, R86.1, U18.3, C60.1)
+ NET_C(I_FLY, Q1.E)
+ NET_C(R11.2, R12.1, Q1.B)
+ NET_C(Q1.C, R24.1, U7.2, U7.4, U12.4)
+ NET_C(C16.2, U7.5)
+ NET_C(C67.1, GND)
+ NET_C(R35.1, U7.6, U7.7, C8.1)
+ NET_C(U7.3, R27.1, D3.A)
+ NET_C(R27.2, Q7.B)
+ NET_C(Q7.C, R36.1)
+ NET_C(R36.2, C23.1, U12.5)
+ NET_C(C33.1, GND)
+ NET_C(U12.2, U12.6, D6.K, R45.1, C24.2)
+ NET_C(U12.7, D6.A, R45.2, R44.1)
+ NET_C(U12.3, C46.1)
+ NET_C(C46.2, C45.1, R59.1)
+ NET_C(C45.2, R72.2, U17.3)
+ NET_C(R59.2, U17.2, U17.6, C57.1)
+ NET_C(I_VM12, U17.4, C56.2)
+ NET_C(C55.1, GND)
+ NET_C(C57.2, R73.1)
+ NET_C(D3.K, R46.1)
+ NET_C(R46.2, R87.1, R80.2, R88.2, C66.1)
+ NET_C(R73.2, R74.2, D8.K)
+ NET_C(D8.A, R80.1, D9.A)
+ NET_C(D9.K, R86.2, C65.1)
+ NET_C(C65.2, R82.1)
+ NET_C(R82.2, U18.2, R81.1)
+ NET_C(R81.2, U18.6)
+ NET_C(I_V12, U18.7, C59.2)
+ NET_C(I_VM12, U18.4, C60.2)
+ NET_C(C59.1, GND)
+ ALIAS(BUZZZ, U18.6)
+
+ //
+ // Mixer
+ //
+
+ NET_C(BOING, R95.1)
+ NET_C(ZIP, R93.1)
+ NET_C(HOP, R94.1)
+ NET_C(CROAK, R92.1)
+ NET_C(SPLASH, R91.1)
+ NET_C(BUZZZ, R96.1)
+ NET_C(R95.3, R93.3, R94.3, R92.3, R91.3, R96.3, R90.1)
+ ALIAS(OUTPUT, R90.1)
+ NET_C(R90.2, GND)
+
+ //
+ // Unconnected inputs
+ //
+
+
+ //
+ // Unconnected outputs
+ //
+
+#if (ENABLE_FRONTIERS)
+#define RXX 192
+ OPTIMIZE_FRONTIER(BOING, RES_M(1), RXX)
+#endif
+
+NETLIST_END()
diff --git a/src/mame/audio/nl_frogs.h b/src/mame/audio/nl_frogs.h
new file mode 100644
index 00000000000..c1a2cedc56b
--- /dev/null
+++ b/src/mame/audio/nl_frogs.h
@@ -0,0 +1,10 @@
+// license:CC0
+// copyright-holders:Aaron Giles
+#ifndef MAME_AUDIO_NL_FROGS_H
+#define MAME_AUDIO_NL_FROGS_H
+
+#pragma once
+
+NETLIST_EXTERNAL(frogs)
+
+#endif // MAME_AUDIO_NL_FROGS_H
diff --git a/src/mame/audio/vicdual.cpp b/src/mame/audio/vicdual.cpp
index 99e904e6d77..2c44cd6107c 100644
--- a/src/mame/audio/vicdual.cpp
+++ b/src/mame/audio/vicdual.cpp
@@ -10,188 +10,7 @@
#include "includes/vicdual.h"
#include "audio/nl_brdrline.h"
-
-
-/************************************************************************
- * frogs Sound System Analog emulation
- * Oct 2004, Derrick Renaud
- ************************************************************************/
-
-
-/* Discrete Sound Input Nodes */
-#define FROGS_FLY_EN NODE_01
-#define FROGS_JUMP_EN NODE_03
-#define FROGS_HOP_EN NODE_04
-#define FROGS_TONGUE_EN NODE_05
-#define FROGS_CAPTURE_EN NODE_06
-#define FROGS_SPLASH_EN NODE_08
-
-/* Nodes - Sounds */
-#define FROGS_BUZZZ_SND NODE_11
-#define FROGS_BOING_SND NODE_13
-#define FROGS_HOP_SND NODE_14
-#define FROGS_ZIP_SND NODE_15
-#define FROGS_CROAK_SND NODE_16
-#define FROGS_SPLASH_SND NODE_18
-/* VRs */
-#define FROGS_R93 NODE_25
-
-static const discrete_555_desc frogsZip555m =
-{
- DISC_555_OUT_CAP | DISC_555_OUT_DC | DISC_555_TRIGGER_IS_LOGIC,
- 12, // B+ voltage of 555
- DEFAULT_555_VALUES
-};
-
-static const discrete_555_cc_desc frogsZip555cc =
-{
- DISC_555_OUT_CAP | DISC_555_OUT_DC,
- 12, // B+ voltage of 555
- DEFAULT_555_VALUES,
- 0.6 // Q13 Vbe
-};
-
-static const discrete_mixer_desc frogsMixer =
-{
- DISC_MIXER_IS_OP_AMP,
- {RES_K(1), RES_K(5)},
- {FROGS_R93, 0},
- {CAP_U(0.01), CAP_U(0.01)},
- 0, RES_K(56), 0, CAP_U(0.1), 0, 10000
-};
-
-static DISCRETE_SOUND_START(frogs_discrete)
- /************************************************
- * Input register mapping for frogs
- *
- * All inputs are inverted by initial transistor.
- ************************************************/
- DISCRETE_INPUT_LOGIC(FROGS_FLY_EN)
- DISCRETE_INPUT_NOT(FROGS_JUMP_EN)
- DISCRETE_INPUT_NOT(FROGS_HOP_EN)
- DISCRETE_INPUT_NOT(FROGS_TONGUE_EN)
- DISCRETE_INPUT_NOT(FROGS_CAPTURE_EN)
- DISCRETE_INPUT_NOT(FROGS_SPLASH_EN)
-
- DISCRETE_ADJUSTMENT(FROGS_R93, RES_M(1), RES_K(10), DISC_LOGADJ, "R93")
-
- DISCRETE_555_MSTABLE(NODE_30, 1, FROGS_TONGUE_EN, RES_K(100), CAP_U(1), &frogsZip555m)
-
- /* Q11 & Q12 transform the voltage from the oneshot U4, to what is
- * needed by the 555CC circuit. Vin to R29 must be > 1V for things
- * to change. <=1 then The Vout of this circuit is 12V.
- * The Current through R28 equals current through R51. iR28 = iR51
- * So when Vin>.5, iR51 = (Vin-.5)/39k. =0 when Vin<=.5
- * So the voltage drop across R28 is vR28 = iR51 * 22k.
- * Finally the Vout = 12 - vR28.
- * Note this formula only works when Vin < 39/(22+39)*12V+1.
- * Which it always is, due to the 555 clamping to 12V*2/3.
- * The Zip effect is hard to emulate 100% due to loading effects
- * of the output stage on the charge stage. So I added some values
- * to get a similar waveshape to the breadboarded circuit.
- */
- DISCRETE_TRANSFORM5(NODE_31, 12, NODE_30, .5, RES_K(22)/RES_K(39), 0, "012-P4>*3*-")
-
- DISCRETE_555_CC(NODE_32, 1, NODE_31, RES_K(1.1), CAP_U(0.14), 0, RES_K(100), 500, &frogsZip555cc)
-
- DISCRETE_MIXER2(NODE_90, 1, NODE_32, 0, &frogsMixer)
-
- DISCRETE_OUTPUT(NODE_90, 1)
-
-DISCRETE_SOUND_END
-
-static const char *const frogs_sample_names[] =
-{
- "*frogs",
- "boing",
- "buzzz",
- "croak",
- "hop",
- "splash",
- "zip",
- nullptr
-};
-
-
-void vicdual_state::frogs_audio(machine_config &config)
-{
- SAMPLES(config, m_samples);
- m_samples->set_channels(5);
- m_samples->set_samples_names(frogs_sample_names);
- m_samples->add_route(ALL_OUTPUTS, "mono", 0.35);
-
- DISCRETE(config, m_discrete, frogs_discrete);
- m_discrete->add_route(ALL_OUTPUTS, "mono", 1.0);
-}
-
-
-TIMER_CALLBACK_MEMBER( vicdual_state::frogs_croak_callback )
-{
- m_samples->stop(2);
-}
-
-
-MACHINE_START_MEMBER(vicdual_state,frogs_audio)
-{
- m_frogs_croak_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(vicdual_state::frogs_croak_callback), this));
-
- machine_start();
-}
-
-
-void vicdual_state::frogs_audio_w(uint8_t data)
-{
- static int last_croak = 0;
- static int last_buzzz = 0;
- int new_croak = data & 0x08;
- int new_buzzz = data & 0x10;
-
-// m_discrete->write(FROGS_HOP_EN, data & 0x01);
-// m_discrete->write(FROGS_JUMP_EN, data & 0x02);
- m_discrete->write(FROGS_TONGUE_EN, data & 0x04);
-// m_discrete->write(FROGS_CAPTURE_EN, data & 0x08);
-// m_discrete->write(FROGS_FLY_EN, data & 0x10);
-// m_discrete->write(FROGS_SPLASH_EN, data & 0x80);
-
- if (data & 0x01)
- m_samples->start(3, 3); // Hop
- if (data & 0x02)
- m_samples->start(0, 0); // Boing
- if (new_croak)
- m_samples->start(2, 2); // Croak
- else
- {
- if (last_croak)
- {
- /* The croak will keep playing until .429s after being disabled */
- m_frogs_croak_timer->adjust(attotime::from_double(1.1 * RES_K(390) * CAP_U(1)));
- }
- }
- if (new_buzzz)
- {
- /* The Buzzz sound starts off a little louder in volume then
- * settles down to a steady buzzz. Whenever the trigger goes
- * low, the sound is disabled. If it then goes high, the buzzz
- * then starts off louder again. The games does this every time
- * the fly moves.
- * So I made the sample start with the louder effect and then play
- * for 12 seconds. A fly should move before this. If not the
- * sample loops, adding the loud part as if the fly moved.
- * This is obviously incorrect, but a fly never stands still for
- * 12 seconds.
- */
- if (!last_buzzz)
- m_samples->start(1, 1, true); // Buzzz
- }
- else
- m_samples->stop(1);
- if (data & 0x80)
- m_samples->start(4, 4); // Splash
-
- last_croak = new_croak;
- last_buzzz = new_buzzz;
-}
-
+#include "audio/nl_frogs.h"
/************************************************************************
@@ -481,101 +300,55 @@ void vicdual_state::invho2_audio_w(uint8_t data)
}
-/*
-static const char *const brdrline_sample_names[] =
-{
- "*brdrline",
- "boot_and_start",
- "coin",
- "crashes",
- "end_level",
- "engine_noise",
- "field",
- "fire",
- nullptr
-};
-
-
-void vicdual_state::brdrline_audio(machine_config &config)
-{
- SAMPLES(config, m_samples);
- m_samples->set_channels(7);
- m_samples->set_samples_names(brdrline_sample_names);
- m_samples->add_route(ALL_OUTPUTS, "mono", 0.35);
-}
-
-void vicdual_state::brdrline_audio_w(uint8_t data)
-{
- uint8_t res = data ^ 0xff;
-
-// if(res & 2) // low fuel, MISSING
-
- if(res & 8) // end level
- m_samples->start(3, 3);
-
- if(res & 0x10) // moving in the brush
- m_samples->start(5, 5);
-
- if(res & 0x20) // fire
- m_samples->start(6, 6);
-
- if(res & 0x40) // car engine noise
- m_samples->start(4, 4);
-
- if(res & 0x80) // crashes
- m_samples->start(2, 2);
-
- //printf("%02x\n",res);
-}
-
-void vicdual_state::brdrline_audio_aux_w(uint8_t data)
-{
- if(data & 0xfc) // coin, unknown which is the trigger
- m_samples->start(1, 1);
- else // boot sample
- m_samples->start(0, 0);
-}
-*/
-
-
/*************************************
*
- * Borderline
+ * Netlist-based Vic Dual Audio
*
*************************************/
-borderline_audio_device::borderline_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) :
- device_t(mconfig, BORDERLINE_AUDIO, tag, owner, clock),
+vicdual_audio_device_base::vicdual_audio_device_base(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u8 inputs_mask, void (*netlist)(netlist::nlparse_t &), double output_scale) :
+ device_t(mconfig, type, tag, owner, clock),
device_mixer_interface(mconfig, *this),
- m_input_line(*this, "sound_nl:in_%u", 0)
+ m_input_line(*this, "sound_nl:in_%u", 0),
+ m_inputs_mask(inputs_mask),
+ m_netlist(netlist),
+ m_output_scale(output_scale)
{
}
-void borderline_audio_device::device_add_mconfig(machine_config &config)
+void vicdual_audio_device_base::device_add_mconfig(machine_config &config)
{
NETLIST_SOUND(config, "sound_nl", 48000)
- .set_source(NETLIST_NAME(brdrline))
+ .set_source(m_netlist)
.add_route(ALL_OUTPUTS, *this, 1.0);
- NETLIST_LOGIC_INPUT(config, m_input_line[0], "I_SOUND_0.IN", 0);
- NETLIST_LOGIC_INPUT(config, m_input_line[1], "I_SOUND_1.IN", 0);
- NETLIST_LOGIC_INPUT(config, m_input_line[2], "I_SOUND_2.IN", 0);
- NETLIST_LOGIC_INPUT(config, m_input_line[3], "I_SOUND_3.IN", 0);
- NETLIST_LOGIC_INPUT(config, m_input_line[4], "I_SOUND_4.IN", 0);
- NETLIST_LOGIC_INPUT(config, m_input_line[5], "I_SOUND_5.IN", 0);
- NETLIST_LOGIC_INPUT(config, m_input_line[6], "I_SOUND_6.IN", 0);
- NETLIST_LOGIC_INPUT(config, m_input_line[7], "I_SOUND_7.IN", 0);
-
- NETLIST_STREAM_OUTPUT(config, "sound_nl:cout0", 0, "OUTPUT").set_mult_offset(1.0, 0.0);
+ if (BIT(m_inputs_mask, 0))
+ NETLIST_LOGIC_INPUT(config, m_input_line[0], "I_SOUND_0.IN", 0);
+ if (BIT(m_inputs_mask, 1))
+ NETLIST_LOGIC_INPUT(config, m_input_line[1], "I_SOUND_1.IN", 0);
+ if (BIT(m_inputs_mask, 2))
+ NETLIST_LOGIC_INPUT(config, m_input_line[2], "I_SOUND_2.IN", 0);
+ if (BIT(m_inputs_mask, 3))
+ NETLIST_LOGIC_INPUT(config, m_input_line[3], "I_SOUND_3.IN", 0);
+ if (BIT(m_inputs_mask, 4))
+ NETLIST_LOGIC_INPUT(config, m_input_line[4], "I_SOUND_4.IN", 0);
+ if (BIT(m_inputs_mask, 5))
+ NETLIST_LOGIC_INPUT(config, m_input_line[5], "I_SOUND_5.IN", 0);
+ if (BIT(m_inputs_mask, 6))
+ NETLIST_LOGIC_INPUT(config, m_input_line[6], "I_SOUND_6.IN", 0);
+ if (BIT(m_inputs_mask, 7))
+ NETLIST_LOGIC_INPUT(config, m_input_line[7], "I_SOUND_7.IN", 0);
+
+ NETLIST_STREAM_OUTPUT(config, "sound_nl:cout0", 0, "OUTPUT").set_mult_offset(m_output_scale, 0.0);
}
-void borderline_audio_device::device_start()
+void vicdual_audio_device_base::device_start()
{
save_item(NAME(m_input_state));
}
-void borderline_audio_device::write(u8 value)
+void vicdual_audio_device_base::write(u8 value)
{
if (value != m_input_state)
{
@@ -586,4 +359,31 @@ void borderline_audio_device::write(u8 value)
}
}
+
+/*************************************
+ *
+ * Borderline/Tranquilizer Gun
+ *
+ *************************************/
+
DEFINE_DEVICE_TYPE(BORDERLINE_AUDIO, borderline_audio_device, "borderline_audio", "Borderline Sound Board")
+
+borderline_audio_device::borderline_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) :
+ vicdual_audio_device_base(mconfig, BORDERLINE_AUDIO, tag, owner, clock, 0xff, NETLIST_NAME(brdrline), 1.0)
+{
+}
+
+
+
+/*************************************
+ *
+ * Frogs
+ *
+ *************************************/
+
+DEFINE_DEVICE_TYPE(FROGS_AUDIO, frogs_audio_device, "frogs_audio", "Frogs Sound Board")
+
+frogs_audio_device::frogs_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) :
+ vicdual_audio_device_base(mconfig, FROGS_AUDIO, tag, owner, clock, 0xff, NETLIST_NAME(frogs), 1.0)
+{
+}
diff --git a/src/mame/audio/vicdual.h b/src/mame/audio/vicdual.h
index ab8aa45086e..e0a918899e2 100644
--- a/src/mame/audio/vicdual.h
+++ b/src/mame/audio/vicdual.h
@@ -9,22 +9,41 @@
#include "netlist/nl_setup.h"
-class borderline_audio_device : public device_t, public device_mixer_interface
+class vicdual_audio_device_base : public device_t, public device_mixer_interface
{
-public:
- borderline_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
+protected:
+ vicdual_audio_device_base(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u8 inputs_mask, void (*netlist)(netlist::nlparse_t &), double output_scale);
virtual void device_add_mconfig(machine_config &config) override;
virtual void device_start() override;
+public:
void write(u8 data);
private:
optional_device_array<netlist_mame_logic_input_device, 8> m_input_line;
u8 m_input_state = 0xff;
+ u8 const m_inputs_mask;
+ void (*const m_netlist)(netlist::nlparse_t &);
+ double const m_output_scale;
+};
+
+
+class borderline_audio_device : public vicdual_audio_device_base
+{
+public:
+ borderline_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
+};
+
+
+class frogs_audio_device : public vicdual_audio_device_base
+{
+public:
+ frogs_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
};
DECLARE_DEVICE_TYPE(BORDERLINE_AUDIO, borderline_audio_device)
+DECLARE_DEVICE_TYPE(FROGS_AUDIO, frogs_audio_device)
#endif // MAME_AUDIO_VICDUAL_H
diff --git a/src/mame/drivers/vicdual.cpp b/src/mame/drivers/vicdual.cpp
index 88e8514a2e2..be4c5516c87 100644
--- a/src/mame/drivers/vicdual.cpp
+++ b/src/mame/drivers/vicdual.cpp
@@ -477,7 +477,7 @@ uint8_t vicdual_state::frogs_io_r(offs_t offset)
void vicdual_state::frogs_io_w(offs_t offset, uint8_t data)
{
if (offset & 0x01) assert_coin_status();
- if (offset & 0x02) frogs_audio_w(data);
+ if (offset & 0x02) m_vicdual_sound->write(data);
}
@@ -557,14 +557,12 @@ void vicdual_state::frogs(machine_config &config)
m_maincpu->set_addrmap(AS_PROGRAM, &vicdual_state::frogs_map);
m_maincpu->set_addrmap(AS_IO, &vicdual_state::frogs_io_map);
- MCFG_MACHINE_START_OVERRIDE(vicdual_state,frogs_audio)
-
/* video hardware */
m_screen->set_screen_update(FUNC(vicdual_state::screen_update_bw));
/* audio hardware */
SPEAKER(config, "mono").front_center();
- frogs_audio(config);
+ FROGS_AUDIO(config, m_vicdual_sound, 0).add_route(ALL_OUTPUTS, "mono", 1.0);
}
@@ -1168,12 +1166,8 @@ void carnival_state::carnival_io_w(offs_t offset, uint8_t data)
void vicdual_state::brdrline_io_w(offs_t offset, uint8_t data)
{
- if (offset & 0x01) m_borderline_sound->write(data);
- if (offset & 0x02)
- {
- palette_bank_w(data);
-// brdrline_audio_aux_w(data);
- }
+ if (offset & 0x01) m_vicdual_sound->write(data);
+ if (offset & 0x02) palette_bank_w(data);
if (offset & 0x08) assert_coin_status();
}
@@ -2279,7 +2273,7 @@ void vicdual_state::brdrline(machine_config &config)
/* audio hardware */
SPEAKER(config, "mono").front_center();
- BORDERLINE_AUDIO(config, "borderline_sound", 0).add_route(ALL_OUTPUTS, "mono", 1.0);
+ BORDERLINE_AUDIO(config, m_vicdual_sound, 0).add_route(ALL_OUTPUTS, "mono", 1.0);
}
diff --git a/src/mame/includes/vicdual.h b/src/mame/includes/vicdual.h
index 0c00c712f0a..94edc7e6884 100644
--- a/src/mame/includes/vicdual.h
+++ b/src/mame/includes/vicdual.h
@@ -30,7 +30,7 @@ public:
m_coinstate_timer(*this, "coinstate"),
m_nsub_coinage_timer(*this, "nsub_coin"),
m_screen(*this, "screen"),
- m_borderline_sound(*this, "borderline_sound"),
+ m_vicdual_sound(*this, "vicdual_sound"),
m_proms(*this, "proms"),
m_videoram(*this, "videoram"),
m_characterram(*this, "characterram"),
@@ -51,7 +51,6 @@ public:
void headonn(machine_config &config);
void invho2(machine_config &config);
void frogs(machine_config &config);
- void frogs_audio(machine_config &config);
void headons(machine_config &config);
void invinco(machine_config &config);
void invinco_audio(machine_config &config);
@@ -89,7 +88,7 @@ protected:
required_device<timer_device> m_coinstate_timer;
optional_device<timer_device> m_nsub_coinage_timer;
required_device<screen_device> m_screen;
- optional_device<borderline_audio_device> m_borderline_sound;
+ optional_device<vicdual_audio_device_base> m_vicdual_sound;
optional_memory_region m_proms;
required_shared_ptr<uint8_t> m_videoram;
@@ -148,10 +147,8 @@ protected:
void invinco_io_w(offs_t offset, uint8_t data);
/*----------- defined in audio/vicdual.cpp -----------*/
- void frogs_audio_w(uint8_t data);
void headon_audio_w(uint8_t data);
void invho2_audio_w(uint8_t data);
- TIMER_CALLBACK_MEMBER( frogs_croak_callback );
/*----------- defined in audio/depthch.cpp -----------*/
void depthch_audio_w(uint8_t data);
@@ -169,7 +166,6 @@ protected:
TIMER_DEVICE_CALLBACK_MEMBER(clear_coin_status);
DECLARE_MACHINE_START(samurai);
- DECLARE_MACHINE_START(frogs_audio);
virtual void machine_start() override;
diff --git a/src/mame/nl.lst b/src/mame/nl.lst
index 8c199c4b74c..0071872f41d 100644
--- a/src/mame/nl.lst
+++ b/src/mame/nl.lst
@@ -370,6 +370,7 @@ brdrline // (c) 1980 Sega
brdrlinet // (c) 1981 Sega
brdrlins // Sidam bootleg
starrkr // (c) 1981 Sega
+frogs // 112-119 [1978 Gremlin?]
@source:zaxxon.cpp
congo // 605-5167 (c) 1983 (2 board stack)