Previous 15994 Revisions Next

r14411 Friday 10th February, 2012 at 03:27:15 UTC by Barry Rodewald
isa_gus: made sound output 16-bit. (no whatsnew)
[src/mess/machine]isa_gus.c

src/mess/machine/isa_gus.c
r14410r14411
267267            }
268268            if(m_voice[x].voice_ctrl & 0x20)
269269            {  // 16-bit PCM
270               m_voice[x].sample = (INT8)((m_wave_ram[(current & 0xffffe)+1]) | ((m_wave_ram[current & 0xffffe])<<8)>>8);
270               m_voice[x].sample = (INT16)((m_wave_ram[current & 0xffffe]) | ((m_wave_ram[(current & 0xffffe)+1])<<8));
271271            }
272272            else
273273            {  // 8-bit PCM
274               m_voice[x].sample = (INT8)m_wave_ram[current & 0xfffff];
274               m_voice[x].sample = (INT16)(m_wave_ram[current & 0xfffff] << 8);
275275            }
276276            // TODO: implement proper panning
277            (*left) += ((m_voice[x].sample) * (vol/256));
278            (*right) += ((m_voice[x].sample) * (vol/256));
277            (*left) += ((m_voice[x].sample) * (vol/65536.0));
278            (*right) += ((m_voice[x].sample) * (vol/65536.0));
279279            left++;
280280            right++;
281281            if(m_voice[x].voice_ctrl & 0x40)  // voice direction
r14410r14411
283283            else
284284               m_voice[x].current_addr += (m_voice[x].freq_ctrl >> 1);
285285#ifdef LOG_SOUND
286            INT32 smp = (m_voice[x].sample) * (vol / 256);
286            INT32 smp = (m_voice[x].sample) * (vol / 65536.0);
287287            fwrite(&smp,4,1,f);
288288#endif
289289         }

Previous 15994 Revisions Next


© 1998-2018 The MESS Team