Previous 199869 Revisions Next

r17433 Thursday 23rd August, 2012 at 22:36:05 UTC by Sandro Ronco
(MESS) hr16: improved a bit the sound quality. (nw)
[src/mess/audio]alesis.c
[src/mess/includes]alesis.h

trunk/src/mess/audio/alesis.c
r17432r17433
66    - volume
77    - panning
88    - output 2
9    - fix 16-bit output to DAC (currently samples are only shifted by 8)
10    - remove noise during patterns recording
119
1210****************************************************************************/
1311
r17432r17433
7068   m_output_active = false;
7169   m_count = 0;
7270   m_cur_sample = 0;
71   m_shift = 0;
7372   memset(m_cmd, 0, sizeof(m_cmd));
7473}
7574
r17432r17433
8281   {
8382      INT16 sample = m_samples[m_cur_sample++];
8483
85      // FIXME
86      sample <<= 8;
84      if (sample == -128 && m_shift)
85      {
86         /*
87                The HR-16 seems to use a simple scheme to generate 16-bit samples from its 8-bit sample ROMs.
88                When the sound starts the 8-bit sample is sent to the most significant bits of the DAC and every
89                time a -1 sample is found the data is shifted one position to right.
90            */
91         sample = m_samples[m_cur_sample++];
92         m_shift--;
8793
88      m_dac->write_signed16(sample + 0x8000);
94         if (LOG)   logerror("DM3AG '%s' shift: %02x\n", tag(), m_shift);
95      }
8996
97      m_dac->write_signed16((sample << m_shift) + 0x8000);
98
9099      // every block ends with three or more -1 samples
91100      if (m_cur_sample == 0xfffff || (m_samples[m_cur_sample-1] == -128 && m_samples[m_cur_sample] == -128 && m_samples[m_cur_sample+1] == -128))
92101      {
r17432r17433
122131      if (m_cur_sample > 0)
123132      {
124133         m_output_active = true;
134         m_shift = 8;
125135
126136         if (LOG)
127137         {
trunk/src/mess/includes/alesis.h
r17432r17433
4949   INT8 *      m_samples;
5050   bool      m_output_active;
5151   int         m_count;
52   int         m_shift;
5253   UINT32      m_cur_sample;
5354   UINT8      m_cmd[5];
5455};

Previous 199869 Revisions Next


© 1997-2024 The MAME Team