mirror of
https://github.com/holub/mame
synced 2025-06-02 10:59:52 +03:00
(MESS) hr16: fixed unending samples. (nw)
This commit is contained in:
parent
bfec2434fe
commit
0d6ceb18d9
@ -80,30 +80,39 @@ void alesis_dm3ag_device::device_timer(emu_timer &timer, device_timer_id id, int
|
|||||||
if (m_output_active)
|
if (m_output_active)
|
||||||
{
|
{
|
||||||
INT16 sample = m_samples[m_cur_sample++];
|
INT16 sample = m_samples[m_cur_sample++];
|
||||||
|
int count = 0;
|
||||||
|
|
||||||
if (sample == -128 && m_shift)
|
while (sample == -128)
|
||||||
|
{
|
||||||
|
count++;
|
||||||
|
|
||||||
|
if (count == 1 && m_shift)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
The HR-16 seems to use a simple scheme to generate 16-bit samples from its 8-bit sample ROMs.
|
The HR-16 seems to use a simple scheme to generate 16-bit samples from its 8-bit sample ROMs.
|
||||||
When the sound starts the 8-bit sample is sent to the most significant bits of the DAC and every
|
When the sound starts the 8-bit sample is sent to the most significant bits of the DAC and every
|
||||||
time a -1 sample is found the data is shifted one position to right.
|
time a -1 sample is found the data is shifted one position to right.
|
||||||
*/
|
*/
|
||||||
sample = m_samples[m_cur_sample++];
|
|
||||||
m_shift--;
|
m_shift--;
|
||||||
|
|
||||||
if (LOG) logerror("DM3AG '%s' shift: %02x\n", tag(), m_shift);
|
if (LOG) logerror("DM3AG '%s' shift: %02x\n", tag(), m_shift);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_dac->write_signed16((sample << m_shift) + 0x8000);
|
|
||||||
|
|
||||||
// every block ends with three or more -1 samples
|
// every block ends with three or more -1 samples
|
||||||
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))
|
if (m_cur_sample == 0xfffff || count >= 3)
|
||||||
{
|
{
|
||||||
m_output_active = false;
|
m_output_active = false;
|
||||||
m_dac->write_signed16(0x8000);
|
sample = 0;
|
||||||
|
|
||||||
if (LOG) logerror("DM3AG '%s' stop: %d\n", tag(), m_cur_sample-((m_cmd[0]<<12) | (m_cmd[1]<<4) | ((m_cmd[2]>>4) & 0x0f)));
|
if (LOG) logerror("DM3AG '%s' stop: %d, len: %d\n", tag(), m_cur_sample, m_cur_sample-((m_cmd[0]<<12) | (m_cmd[1]<<4) | ((m_cmd[2]>>4) & 0x0f)));
|
||||||
|
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sample = m_samples[m_cur_sample++];
|
||||||
|
}
|
||||||
|
|
||||||
|
m_dac->write_signed16((sample << m_shift) + 0x8000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user