Previous 199869 Revisions Next

r23981 Friday 28th June, 2013 at 01:59:26 UTC by hap
and an optimization
[src/emu/sound]ymf271.c ymf271.h ymf278b.c ymf278b.h

trunk/src/emu/sound/ymf278b.c
r23980r23981
251251   INT16 sample = 0;
252252   INT32 *mixp;
253253   INT32 vl, vr;
254   INT32 mix[44100*2];
255254
256   memset(mix, 0, sizeof(mix[0])*samples*2);
255   memset(m_mix_buffer, 0, sizeof(m_mix_buffer[0])*samples*2);
257256
258257   for (i = 0; i < 24; i++)
259258   {
r23980r23981
261260
262261      if (slot->active)
263262      {
264         mixp = mix;
263         mixp = m_mix_buffer;
265264
266265         for (j = 0; j < samples; j++)
267266         {
r23980r23981
320319      }
321320   }
322321
323   mixp = mix;
322   mixp = m_mix_buffer;
324323   vl = m_mix_level[m_pcm_l];
325324   vr = m_mix_level[m_pcm_r];
326325   for (i = 0; i < samples; i++)
r23980r23981
972971   }
973972
974973   m_stream = machine().sound().stream_alloc(*this, 0, 2, clock()/768);
974   m_mix_buffer = auto_alloc_array(machine(), INT32, 44100*2);
975975
976976   // rate tables
977977   precompute_rate_tables();
trunk/src/emu/sound/ymf278b.h
r23980r23981
125125   int m_clock;
126126
127127   sound_stream * m_stream;
128   INT32 *m_mix_buffer;
128129   devcb2_write_line m_irq_handler;
129130};
130131
trunk/src/emu/sound/ymf271.c
r23980r23981
633633   int i, j;
634634   int op;
635635   INT32 *mixp;
636   INT32 mix[48000*2];
637636
638   memset(mix, 0, sizeof(mix[0])*samples*2);
637   memset(m_mix_buffer, 0, sizeof(m_mix_buffer[0])*samples*2);
639638
640639   for (j = 0; j < 12; j++)
641640   {
642641      YMF271Group *slot_group = &m_groups[j];
643      mixp = &mix[0];
642      mixp = m_mix_buffer;
644643
645644      if (slot_group->pfm && slot_group->sync != 3)
646645      {
r23980r23981
656655            int slot2 = j + (1*12);
657656            int slot3 = j + (2*12);
658657            int slot4 = j + (3*12);
659            mixp = &mix[0];
658            mixp = m_mix_buffer;
660659
661660            if (m_slots[slot1].active)
662661            {
r23980r23981
843842               int slot1 = j + ((op + 0) * 12);
844843               int slot2 = j + ((op + 2) * 12);
845844
846               mixp = &mix[0];
845               mixp = m_mix_buffer;
847846               if (m_slots[slot1].active)
848847               {
849848                  for (i = 0; i < samples; i++)
r23980r23981
895894            int slot1 = j + (0*12);
896895            int slot2 = j + (1*12);
897896            int slot3 = j + (2*12);
898            mixp = &mix[0];
897            mixp = m_mix_buffer;
899898
900899            if (m_slots[slot1].active)
901900            {
r23980r23981
981980               }
982981            }
983982
984            mixp = &mix[0];
983            mixp = m_mix_buffer;
985984            update_pcm(j + (3*12), mixp, samples);
986985            break;
987986         }
r23980r23981
997996      }
998997   }
999998
1000   mixp = &mix[0];
999   mixp = m_mix_buffer;
10011000   for (i = 0; i < samples; i++)
10021001   {
10031002      outputs[0][i] = (*mixp++)>>2;
r23980r23981
17111710   init_state();
17121711
17131712   m_stream = machine().sound().stream_alloc(*this, 0, 2, clock()/384);
1713   m_mix_buffer = auto_alloc_array(machine(), INT32, 44100*2);
17141714
17151715   for (i = 0; i < 256; i++)
17161716   {
trunk/src/emu/sound/ymf271.h
r23980r23981
6565      UINT32 loopaddr;
6666      UINT32 endaddr;
6767      INT8   altloop;
68      INT8   fs, srcnote, srcb;
68      INT8   fs;
69      INT8   srcnote, srcb;
6970
7071      INT64 step;
7172      INT64 stepptr;
r23980r23981
138139
139140   emu_timer *m_timA, *m_timB;
140141   sound_stream *m_stream;
142   INT32 *m_mix_buffer;
141143
142144   devcb2_write_line m_irq_handler;
143145   devcb2_read8 m_ext_read_handler;

Previous 199869 Revisions Next


© 1997-2024 The MAME Team