Previous 199869 Revisions Next

r31247 Wednesday 9th July, 2014 at 21:21:38 UTC by Couriersud
Fix some issues introduced with last commit.
The sound system does not allow to stream values > 2^20. Currently limiting the value, but this is not really optimal.
[src/emu/sound]ay8910.c
[src/mame/drivers]1942.c

trunk/src/emu/sound/ay8910.c
r31246r31247
545545        const double Vd = 5.0;
546546        const double Vg = par.m_Vg - par.m_Vth;
547547        const double kn = par.m_Kn[j] / 1.0e6;
548        const double p2 = 1.0 / (2.0 * kn * rd);
549        const double Vs = Vg + p2 - sqrt(p2 * p2 - Vg * Vg);
548        const double p2 = 1.0 / (2.0 * kn * rd) + Vg;
549        const double Vs = p2 - sqrt(p2 * p2 - Vg * Vg);
550550
551551        const double res = rd * ( Vd / Vs - 1.0);
552        tab[j] = res;
552        /* FXIME: That's the biggest value we can stream on to netlist. Have to find a different
553         *        approach.
554         */
555
556        if (res > (1 << 21))
557            tab[j] = (1 << 21);
558        else
559            tab[j] = res;
560        //printf("%d %f %10d\n", j, rd / (res + rd) * 5.0, tab[j]);
553561    }
554562}
555563
r31246r31247
834842       for (chan=0; chan < AY8910_NUM_CHANNELS; chan++)
835843      {
836844         build_mosfet_resistor_table(ay8910_mosfet_param, m_res_load[chan], m_vol_table[chan]);
837         build_mosfet_resistor_table(ay8910_mosfet_param, m_res_load[chan], m_vol_table[chan]);
845         build_mosfet_resistor_table(ay8910_mosfet_param, m_res_load[chan], m_env_table[chan]);
838846      }
839847   }
840848   else
trunk/src/mame/drivers/1942.c
r31246r31247
8484
8585   SOLVER(Solver, 48000)
8686   ANALOG_INPUT(V5, 5)
87    PARAM(Solver.ACCURACY, 1e-10)
87    PARAM(Solver.ACCURACY, 1e-7)
88    //PARAM(Solver.DYNAMIC_TS, 1)
89    //PARAM(Solver.LTE, 5e-8)
8890
8991   /* AY 8910 internal resistors */
9092
r31246r31247
580582
581583   MCFG_NETLIST_STREAM_OUTPUT("snd_nl", 0, "R1.1")
582584   //MCFG_NETLIST_STREAM_OUTPUT("snd_nl", 0, "VR.2")
583   MCFG_NETLIST_ANALOG_MULT_OFFSET(100000.0, 0.0)
585   MCFG_NETLIST_ANALOG_MULT_OFFSET(70000.0, 0.0)
584586
585587MACHINE_CONFIG_END
586588

Previous 199869 Revisions Next


© 1997-2024 The MAME Team