Previous 15994 Revisions Next

r14408 Thursday 9th February, 2012 at 23:11:25 UTC by Barry Rodewald
isa_gus: Fixed 8-bit PCM sound quality, 16-bit PCM is still rather dodgy however. (no whatsnew)
[src/mess/machine]isa_gus.c

src/mess/machine/isa_gus.c
r14407r14408
267267            }
268268            if(m_voice[x].voice_ctrl & 0x20)
269269            {  // 16-bit PCM (needs some work)
270               m_voice[x].sample = (m_wave_ram[(current & 0xffffe)+1] & 0x7f);
271               //m_voice[x].sample |= (m_wave_ram[current & 0xffffe]) >> 6;
272               if(m_wave_ram[(current & 0xffffe)+1] & 0x80)
273                  m_voice[x].sample = -m_voice[x].sample;
270               m_voice[x].sample = (INT16)((m_wave_ram[(current & 0xffffe)+1]) | ((m_wave_ram[current & 0xffffe])<<8)>>8);
274271            }
275272            else
276273            {  // 8-bit PCM
277               m_voice[x].sample = (m_wave_ram[current & 0xfffff] & 0x7f);
278               if(m_wave_ram[current & 0xfffff] & 0x80)
279                  m_voice[x].sample = -m_voice[x].sample;
274               m_voice[x].sample = (INT8)m_wave_ram[current & 0xfffff];
280275            }
281276            // TODO: implement proper panning
282277            (*left) += ((m_voice[x].sample) * (vol/256));
r14407r14408
288283            else
289284               m_voice[x].current_addr += (m_voice[x].freq_ctrl >> 1);
290285#ifdef LOG_SOUND
291            INT32 smp = (m_voice[x].sample) * (vol / 32);
286            INT32 smp = (m_voice[x].sample) * (vol / 256);
292287            fwrite(&smp,4,1,f);
293288#endif
294289         }

Previous 15994 Revisions Next


© 1998-2018 The MESS Team