diff options
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 |
commit | ad4feb8686ad0cf718e53335ad9dca735d8c3d73 (patch) | |
tree | f1ed09037b45a81d5504bc83ec52e6a1dc0c8683 /src/emu | |
parent | 3a329fa78315efe921bb8a6d4958d3c36c749b31 (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')
-rw-r--r-- | src/emu/sound/disc_dev.c | 6 | ||||
-rw-r--r-- | src/emu/sound/disc_mth.c | 17 |
2 files changed, 21 insertions, 2 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) { diff --git a/src/emu/sound/disc_mth.c b/src/emu/sound/disc_mth.c index cba0af2c089..7108bcad4c6 100644 --- a/src/emu/sound/disc_mth.c +++ b/src/emu/sound/disc_mth.c @@ -1167,7 +1167,7 @@ static DISCRETE_STEP(dst_mixer) bit_mask = bit_mask << 1; } } - else + else if (c_bit_flag != 0) { /* no r_nodes, so just do high pass filtering */ for (bit = 0; bit < context->size; bit++) @@ -1183,6 +1183,20 @@ static DISCRETE_STEP(dst_mixer) i += ((type == DISC_MIXER_IS_OP_AMP) ? v_ref - vTemp : vTemp) / info->r[bit]; } } + else + { + /* no r_nodes or c_nodes, mixing only */ + if (type == DISC_MIXER_IS_OP_AMP) + { + for (bit = 0; bit < context->size; bit++) + i += ( v_ref - DST_MIXER__IN(bit) ) / info->r[bit]; + } + else + { + for (bit = 0; bit < context->size; bit++) + i += DST_MIXER__IN(bit) / info->r[bit]; + } + } if (type == DISC_MIXER_IS_OP_AMP_WITH_RI) i += v_ref / rI; @@ -1222,6 +1236,7 @@ static DISCRETE_STEP(dst_mixer) } } + static DISCRETE_RESET(dst_mixer) { const discrete_mixer_desc *info = (const discrete_mixer_desc *)node->custom; |