mirror of
https://github.com/SourMesen/Mesen.git
synced 2024-06-02 19:38:32 -04:00
Sunsoft 5B: Fixed audio period (was off by 1)
This commit is contained in:
parent
a01c400975
commit
134a2a07e5
|
@ -12,7 +12,7 @@ private:
|
||||||
uint8_t _currentRegister;
|
uint8_t _currentRegister;
|
||||||
uint8_t _registers[0x10];
|
uint8_t _registers[0x10];
|
||||||
int16_t _lastOutput;
|
int16_t _lastOutput;
|
||||||
uint16_t _timer[3];
|
int16_t _timer[3];
|
||||||
uint8_t _toneStep[3];
|
uint8_t _toneStep[3];
|
||||||
bool _processTick;
|
bool _processTick;
|
||||||
|
|
||||||
|
@ -54,8 +54,8 @@ private:
|
||||||
void UpdateChannel(int channel)
|
void UpdateChannel(int channel)
|
||||||
{
|
{
|
||||||
_timer[channel]--;
|
_timer[channel]--;
|
||||||
if(_timer[channel] == 0) {
|
if(_timer[channel] <= 0) {
|
||||||
_timer[channel] = GetPeriod(channel) + 1;
|
_timer[channel] = GetPeriod(channel);
|
||||||
_toneStep[channel] = (_toneStep[channel] + 1) & 0x0F;
|
_toneStep[channel] = (_toneStep[channel] + 1) & 0x0F;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -78,7 +78,7 @@ protected:
|
||||||
{
|
{
|
||||||
BaseExpansionAudio::StreamState(saving);
|
BaseExpansionAudio::StreamState(saving);
|
||||||
|
|
||||||
ArrayInfo<uint16_t> timer{ _timer, 3 };
|
ArrayInfo<int16_t> timer{ _timer, 3 };
|
||||||
ArrayInfo<uint8_t> registers{ _registers, 0x10 };
|
ArrayInfo<uint8_t> registers{ _registers, 0x10 };
|
||||||
ArrayInfo<uint8_t> toneStep{ _toneStep, 3 };
|
ArrayInfo<uint8_t> toneStep{ _toneStep, 3 };
|
||||||
Stream(timer, registers, toneStep, _currentRegister, _lastOutput, _processTick);
|
Stream(timer, registers, toneStep, _currentRegister, _lastOutput, _processTick);
|
||||||
|
|
Loading…
Reference in a new issue