summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Michaël Banaan Ananas <happppp@users.noreply.github.com>2011-08-14 13:40:02 +0000
committer Michaël Banaan Ananas <happppp@users.noreply.github.com>2011-08-14 13:40:02 +0000
commit26005610c01c30c93bc93dced3b5cd3d956bbe06 (patch)
tree9ffd9d4afc5a1652699bd58517a7d8b071185fc8
parent3a4dc7ae8e617e1dda0bd5fe955e9e0e08eda04c (diff)
update counter after adding sample, not before
-rw-r--r--src/mame/audio/flower.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/mame/audio/flower.c b/src/mame/audio/flower.c
index 223f19b2321..7179df16326 100644
--- a/src/mame/audio/flower.c
+++ b/src/mame/audio/flower.c
@@ -133,24 +133,26 @@ static STREAM_UPDATE( flower_update_mono )
for (i = 0; i < samples; i++)
{
- voice->pos += f;
-
+ // add sample
if (voice->oneshot)
{
- if (voice->active)
+ UINT8 sample = state->m_sample_rom[(voice->start + voice->pos) >> 7 & 0x7fff];
+ if (sample == 0xff)
{
- UINT8 sample = state->m_sample_rom[(voice->start + voice->pos) >> 7 & 0x7fff];
- if (sample == 0xff)
- voice->active = 0;
- else
- *mix++ += state->m_volume_rom[v << 8 | sample] - 0x80;
+ voice->active = 0;
+ break;
}
+ else
+ *mix++ += state->m_volume_rom[v << 8 | sample] - 0x80;
}
else
{
UINT8 sample = state->m_sample_rom[(voice->start >> 7 & 0x7e00) | (voice->pos >> 7 & 0x1ff)];
*mix++ += state->m_volume_rom[v << 8 | sample] - 0x80;
}
+
+ // update counter
+ voice->pos += f;
}
}