From f24c464f3f8783dd9fdbeeaa21b02658c1340ec3 Mon Sep 17 00:00:00 2001 From: Frank-74 Date: Thu, 1 Sep 2016 16:28:23 +0100 Subject: [PATCH] GetLength must be multiple of 8 According to LaC's n64 hardware dox, the AI_LEN_REG must be a multiple of 8 not 4. --- Source/Project64-core/N64System/Mips/Audio.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Project64-core/N64System/Mips/Audio.cpp b/Source/Project64-core/N64System/Mips/Audio.cpp index d6692cf1c..c113741b2 100644 --- a/Source/Project64-core/N64System/Mips/Audio.cpp +++ b/Source/Project64-core/N64System/Mips/Audio.cpp @@ -38,10 +38,10 @@ uint32_t CAudio::GetLength() uint32_t TimeLeft = g_SystemTimer->GetTimer(CSystemTimer::AiTimerInterrupt), Res = 0; if (TimeLeft > 0) { - Res = (TimeLeft / m_CountsPerByte); + Res = (TimeLeft / m_CountsPerByte)&~7; } WriteTrace(TraceAudio, TraceDebug, "Done (res = %d, TimeLeft = %d)", Res, TimeLeft); - return (Res + 3)&~3; + return Res; } uint32_t CAudio::GetStatus() @@ -157,4 +157,4 @@ void CAudio::SetFrequency(uint32_t Dacrate, uint32_t System) //m_BytesPerSecond = 128024; m_FramesPerSecond = System == SYSTEM_PAL ? 50 : 60; -} \ No newline at end of file +}