trunk/src/emu/sound/ymf278b.c
| r23980 | r23981 | |
| 251 | 251 | INT16 sample = 0; |
| 252 | 252 | INT32 *mixp; |
| 253 | 253 | INT32 vl, vr; |
| 254 | | INT32 mix[44100*2]; |
| 255 | 254 | |
| 256 | | memset(mix, 0, sizeof(mix[0])*samples*2); |
| 255 | memset(m_mix_buffer, 0, sizeof(m_mix_buffer[0])*samples*2); |
| 257 | 256 | |
| 258 | 257 | for (i = 0; i < 24; i++) |
| 259 | 258 | { |
| r23980 | r23981 | |
| 261 | 260 | |
| 262 | 261 | if (slot->active) |
| 263 | 262 | { |
| 264 | | mixp = mix; |
| 263 | mixp = m_mix_buffer; |
| 265 | 264 | |
| 266 | 265 | for (j = 0; j < samples; j++) |
| 267 | 266 | { |
| r23980 | r23981 | |
| 320 | 319 | } |
| 321 | 320 | } |
| 322 | 321 | |
| 323 | | mixp = mix; |
| 322 | mixp = m_mix_buffer; |
| 324 | 323 | vl = m_mix_level[m_pcm_l]; |
| 325 | 324 | vr = m_mix_level[m_pcm_r]; |
| 326 | 325 | for (i = 0; i < samples; i++) |
| r23980 | r23981 | |
| 972 | 971 | } |
| 973 | 972 | |
| 974 | 973 | m_stream = machine().sound().stream_alloc(*this, 0, 2, clock()/768); |
| 974 | m_mix_buffer = auto_alloc_array(machine(), INT32, 44100*2); |
| 975 | 975 | |
| 976 | 976 | // rate tables |
| 977 | 977 | precompute_rate_tables(); |
trunk/src/emu/sound/ymf271.c
| r23980 | r23981 | |
| 633 | 633 | int i, j; |
| 634 | 634 | int op; |
| 635 | 635 | INT32 *mixp; |
| 636 | | INT32 mix[48000*2]; |
| 637 | 636 | |
| 638 | | memset(mix, 0, sizeof(mix[0])*samples*2); |
| 637 | memset(m_mix_buffer, 0, sizeof(m_mix_buffer[0])*samples*2); |
| 639 | 638 | |
| 640 | 639 | for (j = 0; j < 12; j++) |
| 641 | 640 | { |
| 642 | 641 | YMF271Group *slot_group = &m_groups[j]; |
| 643 | | mixp = &mix[0]; |
| 642 | mixp = m_mix_buffer; |
| 644 | 643 | |
| 645 | 644 | if (slot_group->pfm && slot_group->sync != 3) |
| 646 | 645 | { |
| r23980 | r23981 | |
| 656 | 655 | int slot2 = j + (1*12); |
| 657 | 656 | int slot3 = j + (2*12); |
| 658 | 657 | int slot4 = j + (3*12); |
| 659 | | mixp = &mix[0]; |
| 658 | mixp = m_mix_buffer; |
| 660 | 659 | |
| 661 | 660 | if (m_slots[slot1].active) |
| 662 | 661 | { |
| r23980 | r23981 | |
| 843 | 842 | int slot1 = j + ((op + 0) * 12); |
| 844 | 843 | int slot2 = j + ((op + 2) * 12); |
| 845 | 844 | |
| 846 | | mixp = &mix[0]; |
| 845 | mixp = m_mix_buffer; |
| 847 | 846 | if (m_slots[slot1].active) |
| 848 | 847 | { |
| 849 | 848 | for (i = 0; i < samples; i++) |
| r23980 | r23981 | |
| 895 | 894 | int slot1 = j + (0*12); |
| 896 | 895 | int slot2 = j + (1*12); |
| 897 | 896 | int slot3 = j + (2*12); |
| 898 | | mixp = &mix[0]; |
| 897 | mixp = m_mix_buffer; |
| 899 | 898 | |
| 900 | 899 | if (m_slots[slot1].active) |
| 901 | 900 | { |
| r23980 | r23981 | |
| 981 | 980 | } |
| 982 | 981 | } |
| 983 | 982 | |
| 984 | | mixp = &mix[0]; |
| 983 | mixp = m_mix_buffer; |
| 985 | 984 | update_pcm(j + (3*12), mixp, samples); |
| 986 | 985 | break; |
| 987 | 986 | } |
| r23980 | r23981 | |
| 997 | 996 | } |
| 998 | 997 | } |
| 999 | 998 | |
| 1000 | | mixp = &mix[0]; |
| 999 | mixp = m_mix_buffer; |
| 1001 | 1000 | for (i = 0; i < samples; i++) |
| 1002 | 1001 | { |
| 1003 | 1002 | outputs[0][i] = (*mixp++)>>2; |
| r23980 | r23981 | |
| 1711 | 1710 | init_state(); |
| 1712 | 1711 | |
| 1713 | 1712 | m_stream = machine().sound().stream_alloc(*this, 0, 2, clock()/384); |
| 1713 | m_mix_buffer = auto_alloc_array(machine(), INT32, 44100*2); |
| 1714 | 1714 | |
| 1715 | 1715 | for (i = 0; i < 256; i++) |
| 1716 | 1716 | { |