2018-07-01 15:21:05 -04:00
|
|
|
#include "stdafx.h"
|
|
|
|
#include "BaseExpansionAudio.h"
|
|
|
|
#include "Console.h"
|
|
|
|
#include "APU.h"
|
|
|
|
|
|
|
|
BaseExpansionAudio::BaseExpansionAudio(shared_ptr<Console> console)
|
|
|
|
{
|
|
|
|
_console = console;
|
|
|
|
}
|
|
|
|
|
|
|
|
void BaseExpansionAudio::StreamState(bool saving)
|
|
|
|
{
|
|
|
|
Stream(_clocksNeeded);
|
|
|
|
}
|
|
|
|
|
|
|
|
void BaseExpansionAudio::Clock()
|
|
|
|
{
|
|
|
|
if(_console->GetApu()->IsApuEnabled()) {
|
2018-07-13 22:19:26 -04:00
|
|
|
if(_console->GetSettings()->GetOverclockRate() == 100 || !_console->GetSettings()->GetOverclockAdjustApu()) {
|
2018-07-01 15:21:05 -04:00
|
|
|
ClockAudio();
|
|
|
|
} else {
|
2018-07-13 22:19:26 -04:00
|
|
|
_clocksNeeded += 1.0 / ((double)_console->GetSettings()->GetOverclockRate() / 100);
|
2018-07-01 15:21:05 -04:00
|
|
|
while(_clocksNeeded >= 1.0) {
|
|
|
|
ClockAudio();
|
|
|
|
_clocksNeeded--;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|