mirror of
https://github.com/zoriya/ComSquare.git
synced 2025-12-20 14:15:11 +00:00
starting to working of voices and so on BRR, Envelopes, Gauss and Timers as they use each others
22 lines
440 B
C++
22 lines
440 B
C++
//
|
|
// Created by melefo on 2/3/21.
|
|
//
|
|
|
|
#include "DSP.hpp"
|
|
|
|
namespace ComSquare::APU::DSP
|
|
{
|
|
void DSP::timerTick()
|
|
{
|
|
if (!this->_timer.counter)
|
|
this->_timer.counter = 0x7800;
|
|
this->_timer.counter -= 1;
|
|
}
|
|
|
|
bool DSP::timerPoll(uint32_t rate)
|
|
{
|
|
if (!rate)
|
|
return false;
|
|
return (this->_timer.counter + this->_counterOffset[rate]) % this->_rateModulus[rate] == 0;
|
|
}
|
|
} |