mirror of
https://github.com/holub/mame
synced 2025-04-23 08:49:55 +03:00
-spg2xx_audio: Fixed off-by-one on Beat Count timer, fixing timing in icanpian and to an extent shredmjr. [Ryan Holtz]
This commit is contained in:
parent
43ab8a7d0d
commit
fdc92d8bf4
@ -37,7 +37,7 @@ DEFINE_DEVICE_TYPE(SUNPLUS_GCM394_AUDIO, sunplus_gcm394_audio_device, "gcm394_au
|
||||
#define LOG_ALL (LOG_SPU_READS | LOG_SPU_WRITES | LOG_UNKNOWN_SPU | LOG_CHANNEL_READS | LOG_CHANNEL_WRITES \
|
||||
| LOG_ENVELOPES | LOG_SAMPLES | LOG_RAMPDOWN | LOG_BEAT)
|
||||
|
||||
#define VERBOSE (0)
|
||||
#define VERBOSE (LOG_ALL & ~(LOG_SAMPLES | LOG_ENVELOPES))
|
||||
#include "logmacro.h"
|
||||
|
||||
#define SPG_DEBUG_AUDIO (0)
|
||||
@ -1099,12 +1099,23 @@ inline void spg2xx_audio_device::loop_channel(const uint32_t channel)
|
||||
|
||||
void spg2xx_audio_device::audio_beat_tick()
|
||||
{
|
||||
if (m_audio_curr_beat_base_count > 0)
|
||||
{
|
||||
m_audio_curr_beat_base_count--;
|
||||
}
|
||||
|
||||
if (m_audio_curr_beat_base_count == 0)
|
||||
{
|
||||
LOGMASKED(LOG_BEAT, "Beat base count elapsed, reloading with %d\n", m_audio_ctrl_regs[AUDIO_BEAT_BASE_COUNT]);
|
||||
m_audio_curr_beat_base_count = m_audio_ctrl_regs[AUDIO_BEAT_BASE_COUNT];
|
||||
|
||||
uint16_t beat_count = m_audio_ctrl_regs[AUDIO_BEAT_COUNT] & AUDIO_BEAT_COUNT_MASK;
|
||||
if (beat_count > 0)
|
||||
{
|
||||
beat_count--;
|
||||
m_audio_ctrl_regs[AUDIO_BEAT_COUNT] = (m_audio_ctrl_regs[AUDIO_BEAT_COUNT] & ~AUDIO_BEAT_COUNT_MASK) | beat_count;
|
||||
}
|
||||
|
||||
if (beat_count == 0)
|
||||
{
|
||||
if (m_audio_ctrl_regs[AUDIO_BEAT_COUNT] & AUDIO_BIE_MASK)
|
||||
@ -1118,13 +1129,7 @@ void spg2xx_audio_device::audio_beat_tick()
|
||||
LOGMASKED(LOG_BEAT, "Beat count elapsed but IRQ not enabled\n");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
beat_count--;
|
||||
m_audio_ctrl_regs[AUDIO_BEAT_COUNT] = (m_audio_ctrl_regs[AUDIO_BEAT_COUNT] & ~AUDIO_BEAT_COUNT_MASK) | beat_count;
|
||||
}
|
||||
}
|
||||
m_audio_curr_beat_base_count--;
|
||||
}
|
||||
|
||||
void spg2xx_audio_device::audio_rampdown_tick(const uint32_t channel)
|
||||
|
Loading…
Reference in New Issue
Block a user