summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/audio
diff options
context:
space:
mode:
author couriersud <couriersud@gmx.org>2020-09-19 13:04:37 +0200
committer couriersud <couriersud@users.noreply.github.com>2020-09-20 17:49:02 +0200
commit356613b82ee0cc764fbdfe930ac2b69aba3d53ac (patch)
treed949cc48c1326fd71ff4b3f1f6757206063631f6 /src/mame/audio
parent63efcfcb85e2f475b26541d0973b0321c9204598 (diff)
astrob: significant performance increase
* uses all 4 Sonar oscillators * uses randomized resistor values (5% range) * uses frontiers to separate oscillators * improves performance to 340% locally.
Diffstat (limited to 'src/mame/audio')
-rw-r--r--src/mame/audio/nl_astrob.cpp91
1 files changed, 66 insertions, 25 deletions
diff --git a/src/mame/audio/nl_astrob.cpp b/src/mame/audio/nl_astrob.cpp
index ee158301c29..d8fac90fa64 100644
--- a/src/mame/audio/nl_astrob.cpp
+++ b/src/mame/audio/nl_astrob.cpp
@@ -30,7 +30,8 @@
#define HLE_LASER_1_VCO (1)
#define HLE_LASER_2_VCO (1)
-#define SIMPLIFY_SONAR (1)
+#define SIMPLIFY_SONAR (0) // only use one oscillator
+#define ENABLE_SONAR_ALT (1) // use frontiers to separate oscillators, modify UGF
#define ENABLE_FRONTIERS (1)
#define UNDERCLOCK_NOISE_GEN (1)
@@ -58,7 +59,28 @@
#define TTL_74LS00_DIP TTL_7400_DIP
#define TTL_74LS04_DIP TTL_7404_DIP
-
+// Define some random factors (5%)
+
+#define FRND1 1.023
+#define FRND2 1.017
+#define FRND3 1.005
+#define FRND4 1.014
+#define FRND5 1.049
+#define FRND6 1.044
+#define FRND7 1.016
+#define FRND8 1.037
+#define FRND9 1.030
+#define FRND10 1.001
+#define FRND11 1.034
+#define FRND12 1.043
+#define FRND13 1.011
+#define FRND14 1.016
+#define FRND15 1.011
+#define FRND16 1.006
+#define FRND17 1.009
+#define FRND18 1.007
+#define FRND19 1.035
+#define FRND20 1.004
//
// Main netlist
@@ -71,9 +93,11 @@ NETLIST_START(astrob)
PARAM(Solver.DYNAMIC_TS, 1)
PARAM(Solver.DYNAMIC_MIN_TIMESTEP, 4e-5)
#if (SIMPLIFY_SONAR)
- PARAM(Solver.Solver_54.DYNAMIC_MIN_TIMESTEP, 7e-6) // gets rid of NR loops failure
+ PARAM(Solver.Solver_54.DYNAMIC_MIN_TIMESTEP, 4e-6) // gets rid of NR loops failure
#else
- PARAM(Solver.Solver_40.DYNAMIC_MIN_TIMESTEP, 7e-6) // gets rid of NR loops failure
+#if !(ENABLE_SONAR_ALT)
+ PARAM(Solver.Solver_42.DYNAMIC_MIN_TIMESTEP, 6e-6) // gets rid of NR loops failure
+#endif
#endif
#else
SOLVER(Solver, 48000)
@@ -145,15 +169,15 @@ NETLIST_START(astrob)
ANALOG_INPUT(I_V12, 12)
ANALOG_INPUT(I_VM12, -12)
- RES(R1, RES_K(100))
- RES(R2, RES_K(1.5))
- RES(R3, RES_K(330))
- RES(R4, RES_K(10))
+ RES(R1, RES_K(100) * FRND1) // part of SONAR circuit that relies on subtle part differences
+ RES(R2, RES_K(1.5) * FRND2) // part of SONAR circuit that relies on subtle part differences
+ RES(R3, RES_K(330) * FRND3) // part of SONAR circuit that relies on subtle part differences
+ RES(R4, RES_K(10) * FRND4) // part of SONAR circuit that relies on subtle part differences
#if (SIMPLIFY_SONAR)
// use less resistance to account for only emulating 1/4 identical circuits
- RES(R5, RES_K(17))
+ RES(R5, RES_K(17)) // part of SONAR circuit that relies on subtle part differences
#else
- RES(R5, RES_K(68))
+ RES(R5, RES_K(68) * FRND5) // part of SONAR circuit that relies on subtle part differences
#endif
RES(R6, RES_K(68))
RES(R7, RES_K(22))
@@ -185,11 +209,11 @@ NETLIST_START(astrob)
RES(R33, RES_K(39))
RES(R34, RES_K(4.7))
RES(R35, RES_K(4.7))
- RES(R36, RES_K(100.1)) // part of SONAR circuit that relies on subtle part differences
- RES(R37, RES_K(1.51)) // part of SONAR circuit that relies on subtle part differences
- RES(R38, RES_K(330.1)) // part of SONAR circuit that relies on subtle part differences
- RES(R39, RES_K(10.1)) // part of SONAR circuit that relies on subtle part differences
- RES(R40, RES_K(68.1)) // part of SONAR circuit that relies on subtle part differences
+ RES(R36, RES_K(100) * FRND6) // part of SONAR circuit that relies on subtle part differences
+ RES(R37, RES_K(1.5) * FRND7) // part of SONAR circuit that relies on subtle part differences
+ RES(R38, RES_K(330) * FRND8) // part of SONAR circuit that relies on subtle part differences
+ RES(R39, RES_K(10) * FRND9) // part of SONAR circuit that relies on subtle part differences
+ RES(R40, RES_K(68) * FRND10) // part of SONAR circuit that relies on subtle part differences
RES(R41, RES_K(10))
RES(R42, RES_K(100))
RES(R43, RES_K(470))
@@ -211,11 +235,11 @@ NETLIST_START(astrob)
RES(R59, RES_K(100))
RES(R60, RES_K(10))
RES(R61, RES_K(100))
- RES(R62, RES_K(99.9)) // part of SONAR circuit that relies on subtle part differences
- RES(R63, RES_K(1.49)) // part of SONAR circuit that relies on subtle part differences
- RES(R64, RES_K(329.9)) // part of SONAR circuit that relies on subtle part differences
- RES(R65, RES_K(9.9)) // part of SONAR circuit that relies on subtle part differences
- RES(R66, RES_K(67.9)) // part of SONAR circuit that relies on subtle part differences
+ RES(R62, RES_K(100) * FRND11) // part of SONAR circuit that relies on subtle part differences
+ RES(R63, RES_K(1.5) * FRND12) // part of SONAR circuit that relies on subtle part differences
+ RES(R64, RES_K(330) * FRND13) // part of SONAR circuit that relies on subtle part differences
+ RES(R65, RES_K(10) * FRND14) // part of SONAR circuit that relies on subtle part differences
+ RES(R66, RES_K(68) * FRND15) // part of SONAR circuit that relies on subtle part differences
RES(R67, RES_K(10))
RES(R68, RES_K(82))
RES(R69, RES_K(470))
@@ -240,11 +264,11 @@ NETLIST_START(astrob)
RES(R88, RES_K(100))
RES(R89, RES_K(10))
RES(R90, RES_K(100))
- RES(R91, RES_K(100.2)) // part of SONAR circuit that relies on subtle part differences
- RES(R92, RES_K(1.52)) // part of SONAR circuit that relies on subtle part differences
- RES(R93, RES_K(330.2)) // part of SONAR circuit that relies on subtle part differences
- RES(R94, RES_K(10.2)) // part of SONAR circuit that relies on subtle part differences
- RES(R95, RES_K(68.2)) // part of SONAR circuit that relies on subtle part differences
+ RES(R91, RES_K(100) * FRND16) // part of SONAR circuit that relies on subtle part differences
+ RES(R92, RES_K(1.5) * FRND17) // part of SONAR circuit that relies on subtle part differences
+ RES(R93, RES_K(330) * FRND18) // part of SONAR circuit that relies on subtle part differences
+ RES(R94, RES_K(10) * FRND19) // part of SONAR circuit that relies on subtle part differences
+ RES(R95, RES_K(68) * FRND20) // part of SONAR circuit that relies on subtle part differences
RES(R96, RES_K(10))
RES(R97, RES_K(4.7))
RES(R98, RES_M(1))
@@ -464,6 +488,17 @@ NETLIST_START(astrob)
Q_2N4403(Q10)
TL084_DIP(U1) // Op. Amp.
+#if (ENABLE_SONAR_ALT)
+ // Oscillators are of order 1kHz. No need to to have UGF in MHz range
+ PARAM(U1.A.MODEL, "TL084(TYPE=3 UGF=10k)")
+ PARAM(U1.B.MODEL, "TL084(TYPE=3 UGF=10k)")
+ PARAM(U1.C.MODEL, "TL084(TYPE=3 UGF=10k)")
+ PARAM(U1.D.MODEL, "TL084(TYPE=3 UGF=10k)")
+ PARAM(U2.A.MODEL, "TL084(TYPE=3 UGF=10k)")
+ PARAM(U2.B.MODEL, "TL084(TYPE=3 UGF=10k)")
+ PARAM(U2.C.MODEL, "TL084(TYPE=3 UGF=10k)")
+ PARAM(U2.D.MODEL, "TL084(TYPE=3 UGF=10k)")
+#endif
NET_C(U1.4, I_V12)
NET_C(U1.11, I_VM12)
@@ -656,6 +691,12 @@ NETLIST_START(astrob)
NET_C(C40.2, R93.1, U2.9)
NET_C(U2.10, GND)
+#if (ENABLE_SONAR_ALT)
+ OPTIMIZE_FRONTIER(R5.2, RES_K(68), 192)
+ OPTIMIZE_FRONTIER(R40.2, RES_K(68), 192)
+ OPTIMIZE_FRONTIER(R95.2, RES_K(68), 192)
+ OPTIMIZE_FRONTIER(R66.2, RES_K(68), 192)
+#endif
NET_C(R5.1, R40.1, R114.1, Q3.B, R95.1, R66.1)
#endif