Viewing Issue Advanced Details
ID Category [?] Severity [?] Reproducibility Date Submitted Last Update
02936 Sound Minor Always Feb 20, 2009, 23:53 Mar 8, 2009, 16:40
Tester chowell View Status Public Platform MAME (Official Binary)
Assigned To Resolution Open OS
Status [?] Acknowledged Driver
Version 0.129u4 Fixed in Version Build Normal
Fixed in Git Commit Github Pull Request #
Summary 02936: DISCRETE: For op-amp DISCRETE_MIXER (without rI), capacitor cF's exponent will be incorrectly recalculated if rNode[]'s are used.
Description For the DISC_MIXER_IS_OP_AMP (no rI) version of DISCRETE_MIXER, if a feedback capacitor cF is used, and rNode[]'s are also used, cF's exponent will be recalculated incorrectly.

This doesn't affect any current games, since the only games which have an op-amp DISCRETE_MIXER with a cF don't have rNode[]'s. But it might affect future drivers or refinements of existing ones if left uncorrected.

General circuit diagram of an op-amp DISCRETE_MIXER without rI:
                                               cF
                                          .----||---.
                                          |         |
        rNode[0]    r[0]   c[0]           |    rF   |
   IN0 >--zzzz------zzzz----||---.        +---ZZZZ--+
                                 |        |         |
        rNode[1]    r[1]   c[1]  |        |  |\     |
   IN1 >--zzzz------zzzz----||---+--------+  | \    |
    .      .         .      .    |        '--|- \   |  cAmp
    .      .         .      .    |           |   >--+---||-----> Netlist Node
    .      .         .      .    |        .--|+ /
    .   rNode[7]    r[7]   c[7]  |        |  | /
   IN7 >--zzzz------zzzz----||---'        |  |/
                                          |
  vRef >----------------------------------'

In DISCRETE_STEP(dst_mixer) within emu/sound/disc_mth.c, if cF is present, the following code runs (lines 1143-1153 in 129u4):

        /* Do the low pass filtering for cF */
        if (info->cF != 0)
        {
            if (r_node_bit_flag != 0)
            {
                /* Re-calculate exponent if resistor nodes are used */
                context->exponent_c_f =  RC_CHARGE_EXP(r_total * info->cF);
            }
            context->v_cap_f += (v - v_ref - context->v_cap_f) * context->exponent_c_f;
            v = context->v_cap_f;
        }
If there are rNode[]'s, cF's exponent is recalculated using the present total input resistance. But there is no check for the DISC_MIXER_IS_OP_AMP case, for which cF's exponent is based on cF * rF, with no effect from either the static or dynamic input resistances. In this case, the exponent recalculation is completely inappropriate and should be skipped.

The effect would be to do low-pass filtering on the output with an incorrect cut-off frequency.
Steps To Reproduce
Additional Information
Github Commit
Flags
Regression Version
Affected Sets / Systems DISCRETE
Attached Files
 
Relationships
There are no relationship linked to this issue.
Notes
3
User avatar
No.03767
chowell
Developer
Feb 21, 2009, 00:29
Thanks for acknowledging, Tafoid, but why did you change the category to Documentation?
User avatar
No.03781
Tafoid
Administrator
Feb 22, 2009, 03:25
I felt it was documentation for the time when there is a game that might need this understanding for discrete. I suppose I can change it back - excuse my ignorance.
User avatar
No.03920
derrickr
Developer
Mar 8, 2009, 16:40
This is just another case of optimization/laziness. The caps are mostly used to just block DC in this circuit. As you adjust the RNODE, the hardware designer's intent is to just adjust current flow which would change the volume level. The designer was not trying to make an adjustable filter.

Yes theoretical the filters should recalculate, but if it was added you would not hear a difference in most cases. The functionality could be added, but it is not on the top of my to do list.

Unfortunately (and thankfully) the discrete system is not a full-fledged SPICE program. Some trade-offs have to be made for speed. If something just slows the system down, with no real effect in the hearing range, I just ignore it. As do some other sound cores. A lot of them do not even block DC.