summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/sound/disc_dev.c
diff options
context:
space:
mode:
author Couriersud <couriersud@users.noreply.github.com>2009-09-27 17:14:20 +0000
committer Couriersud <couriersud@users.noreply.github.com>2009-09-27 17:14:20 +0000
commitad4feb8686ad0cf718e53335ad9dca735d8c3d73 (patch)
treef1ed09037b45a81d5504bc83ec52e6a1dc0c8683 /src/emu/sound/disc_dev.c
parent3a329fa78315efe921bb8a6d4958d3c36c749b31 (diff)
exp is slow, but pow is even slower
- more LS624 optimization, replace pow(10, x) by pow10(x) - mixer loop optimizations
Diffstat (limited to 'src/emu/sound/disc_dev.c')
-rw-r--r--src/emu/sound/disc_dev.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/emu/sound/disc_dev.c b/src/emu/sound/disc_dev.c
index 160cbf86628..aad021e0905 100644
--- a/src/emu/sound/disc_dev.c
+++ b/src/emu/sound/disc_dev.c
@@ -1597,7 +1597,11 @@ static DISCRETE_RESET(dsd_566)
#define LS624_F(_C, _VI, _VR) pow(10, -0.912029404 * log10(_C) + 0.243264328 * (_VI) \
- 0.091695877 * (_VR) -0.014110946 * (_VI) * (_VR) - 3.207072925)
*/
-#define LS624_F(_VI) pow(10, context->k1 + 0.243264328 * (_VI) + context->k2 * (_VI))
+
+/* pow(10, x) = exp(ln(10)*x) */
+#define pow10(x) exp(2.30258509299404568401*(x))
+
+#define LS624_F(_VI) pow10(context->k1 + 0.243264328 * (_VI) + context->k2 * (_VI))
static DISCRETE_STEP(dsd_ls624)
{