trunk/src/emu/sound/ay8910.c
| r31279 | r31280 | |
| 521 | 521 | |
| 522 | 522 | } |
| 523 | 523 | |
| 524 | | #ifdef UNUSED_FUNCTION |
| 525 | | INLINE void build_resistor_table(const ay8910_device::ay_ym_param *par, INT32 *tab, int zero_is_off) |
| 526 | | { |
| 527 | | int j; |
| 528 | | |
| 529 | | for (j=0; j < par->res_count; j++) |
| 530 | | { |
| 531 | | if (zero_is_off && j == 0) |
| 532 | | { |
| 533 | | tab[j] = 1e6; |
| 534 | | } |
| 535 | | else |
| 536 | | tab[j] = par->res[j]; |
| 537 | | } |
| 538 | | } |
| 539 | | #endif |
| 540 | | |
| 541 | 524 | INLINE void build_mosfet_resistor_table(const ay8910_device::mosfet_param &par, const double rd, INT32 *tab) |
| 542 | 525 | { |
| 543 | 526 | int j; |
| r31279 | r31280 | |
| 551 | 534 | const double Vs = p2 - sqrt(p2 * p2 - Vg * Vg); |
| 552 | 535 | |
| 553 | 536 | const double res = rd * ( Vd / Vs - 1.0); |
| 554 | | /* FXIME: That's the biggest value we can stream on to netlist. Have to find a different |
| 555 | | * approach. |
| 556 | | */ |
| 537 | /* That's the biggest value we can stream on to netlist. */ |
| 557 | 538 | |
| 558 | | if (res > (1 << 21)) |
| 559 | | tab[j] = (1 << 21); |
| 539 | if (res > (1 << 28)) |
| 540 | tab[j] = (1 << 28); |
| 560 | 541 | else |
| 561 | 542 | tab[j] = res; |
| 562 | 543 | //printf("%d %f %10d\n", j, rd / (res + rd) * 5.0, tab[j]); |
| r31279 | r31280 | |
| 815 | 796 | else |
| 816 | 797 | { |
| 817 | 798 | *(buf[0]++) = mix_3D(); |
| 818 | | #if 0 |
| 819 | | *(buf[0]) = ( vol_enabled[0] * m_vol_table[m_Vol[0]] |
| 820 | | + vol_enabled[1] * m_vol_table[m_Vol[1]] |
| 821 | | + vol_enabled[2] * m_vol_table[m_Vol[2]]) / m_step; |
| 822 | | #endif |
| 823 | 799 | } |
| 824 | 800 | samples--; |
| 825 | 801 | } |