Previous 199869 Revisions Next

r32719 Tuesday 14th October, 2014 at 01:53:33 UTC by Alex Jackson
bleh, we save_item(bool) all over the place and using ints for bools is ugly and C-ish (nw)
[src/emu/sound]k053260.c k053260.h

trunk/src/emu/sound/k053260.c
r32718r32719
318318   m_position = 0;
319319   m_counter = 0;
320320   m_output = 0;
321   m_playing = 0;
321   m_playing = false;
322322   m_start = 0;
323323   m_length = 0;
324324   m_pitch = 0;
325325   m_volume = 0;
326326   m_pan = 0;
327   m_loop = 0;
328   m_kadpcm = 0;
327   m_loop = false;
328   m_kadpcm = false;
329329   update_pan_volume();
330330}
331331
r32718r32719
389389
390390   else
391391   {
392      m_position = m_kadpcm; // for kadpcm low bit is nybble offset, so must start at 1 due to preincrement
392      m_position = m_kadpcm ? 1 : 0; // for kadpcm low bit is nybble offset, so must start at 1 due to preincrement
393393      m_counter = 0x1000 - CLOCKS_PER_SAMPLE; // force update on next sound_stream_update
394394      m_output = 0;
395      m_playing = 1;
395      m_playing = true;
396396      if (LOG) logerror("K053260: start = %06x, length = %06x, pitch = %04x, vol = %02x, loop = %s, %s\n",
397397                  m_start, m_length, m_pitch, m_volume, m_loop ? "yes" : "no", m_kadpcm ? "KADPCM" : "PCM" );
398398   }
r32718r32719
402402{
403403   m_position = 0;
404404   m_output = 0;
405   m_playing = 0;
405   m_playing = false;
406406}
407407
408408void k053260_device::KDSC_Voice::play(stream_sample_t *outputs)
r32718r32719
413413   {
414414      m_counter = m_counter - 0x1000 + m_pitch;
415415
416      UINT32 bytepos = ++m_position >> m_kadpcm;
416      UINT32 bytepos = ++m_position >> ( m_kadpcm ? 1 : 0 );
417417      /*
418418      Yes, _pre_increment. Playback must start 1 byte position after the
419419      start address written to the register, or else ADPCM sounds will
r32718r32719
432432         }
433433         else
434434         {
435            m_playing = 0;
435            m_playing = false;
436436            return;
437437         }
438438      }
trunk/src/emu/sound/k053260.h
r32718r32719
8989      UINT16 m_pan_volume[2];
9090      UINT16 m_counter;
9191      INT8   m_output;
92      UINT8  m_playing;
92      bool   m_playing;
9393
9494      // per voice registers
9595      UINT32 m_start;
r32718r32719
9999
100100      // bit packed registers
101101      UINT8  m_pan;
102      UINT8  m_loop;
103      UINT8  m_kadpcm;
102      bool   m_loop;
103      bool   m_kadpcm;
104104   } m_voice[4];
105105
106106   friend class k053260_device::KDSC_Voice;

Previous 199869 Revisions Next


© 1997-2024 The MAME Team