Audio: revert changes to audio, seemed to make games worse

This commit is contained in:
zilmar 2013-01-06 06:52:29 +11:00
parent 08af4e1c88
commit 3c1040c2d9
1 changed files with 16 additions and 26 deletions

View File

@ -55,8 +55,8 @@ void CAudio::LenChanged ( void )
{
WriteTraceF(TraceAudio,__FUNCTION__ ": *** Ignoring Write, To Large (%X)",g_Reg->AI_LEN_REG);
} else {
m_Status |= ai_full | ai_busy;
DWORD AudioLeft = g_SystemTimer->GetTimer(CSystemTimer::AiTimerBusy);
m_Status |= ai_full;
DWORD AudioLeft = g_SystemTimer->GetTimer(CSystemTimer::AiTimerInterrupt);
if (AudioLeft == 0)
{
if (m_SecondBuff)
@ -64,18 +64,10 @@ void CAudio::LenChanged ( void )
g_Notify->BreakPoint(__FILE__,__LINE__);
}
WriteTraceF(TraceAudio,__FUNCTION__ ": Set Timer AI_LEN_REG: %d m_CountsPerByte: %d",g_Reg->AI_LEN_REG,m_CountsPerByte);
g_SystemTimer->SetTimer(CSystemTimer::AiTimerBusy,g_Reg->AI_LEN_REG * m_CountsPerByte,false);
g_SystemTimer->SetTimer(CSystemTimer::AiTimerInterrupt,100,false);
g_SystemTimer->SetTimer(CSystemTimer::AiTimerInterrupt,g_Reg->AI_LEN_REG * m_CountsPerByte,false);
} else {
WriteTraceF(TraceAudio,__FUNCTION__ ": Writing to Second Buffer (m_SecondBuff %d Increase: %d)",m_SecondBuff,g_Reg->AI_LEN_REG);
if (m_SecondBuff != 0)
{
g_Notify->BreakPoint(__FILE__,__LINE__);
}
WriteTraceF(TraceAudio,__FUNCTION__ ": Increasing Second Buffer (m_SecondBuff %d Increase: %d)",m_SecondBuff,g_Reg->AI_LEN_REG);
m_SecondBuff += g_Reg->AI_LEN_REG;
g_SystemTimer->SetTimer(CSystemTimer::AiTimerBusy,(g_Reg->AI_LEN_REG * m_CountsPerByte) + AudioLeft,false);
g_SystemTimer->SetTimer(CSystemTimer::AiTimerInterrupt,AudioLeft,false);
}
}
} else {
@ -96,28 +88,26 @@ void CAudio::LenChanged ( void )
void CAudio::InterruptTimerDone ( void )
{
WriteTraceF(TraceAudio,__FUNCTION__ ": Start (m_SecondBuff = %d)",m_SecondBuff);
m_SecondBuff = 0;
if (g_Reg->m_AudioIntrReg == 0)
if (m_SecondBuff != 0)
{
g_System->SyncToAudio();
g_SystemTimer->SetTimer(CSystemTimer::AiTimerInterrupt,m_SecondBuff * m_CountsPerByte,false);
m_SecondBuff = 0;
} else {
if (g_Reg->m_AudioIntrReg == 0)
{
g_System->SyncToAudio();
}
g_Reg->MI_INTR_REG |= MI_INTR_AI;
g_Reg->CheckInterrupts();
m_Status &= ~ai_full;
}
g_Reg->MI_INTR_REG |= MI_INTR_AI;
g_Reg->CheckInterrupts();
m_Status &= ~ai_full;
WriteTrace(TraceAudio,__FUNCTION__ ": Done");
}
void CAudio::BusyTimerDone ( void )
{
WriteTraceF(TraceAudio,__FUNCTION__ ": Start (m_SecondBuff = %d)",m_SecondBuff);
if (m_SecondBuff)
{
g_Notify->BreakPoint(__FILE__,__LINE__);
}
if ((m_Status & ai_busy) == 0)
{
g_Notify->BreakPoint(__FILE__,__LINE__);
}
g_Notify->BreakPoint(__FILE__,__LINE__);
m_Status &= ~ai_busy;
}