new DSP architecture (is this one correct ?)

Start of voice & echo functions (need to name them)
This commit is contained in:
Melefo
2021-02-03 01:34:43 +01:00
parent 694ea7f9d4
commit 61ef40e968
7 changed files with 774 additions and 302 deletions

84
sources/APU/DSP/Voice.cpp Normal file
View File

@@ -0,0 +1,84 @@
//
// Created by melefo on 2/1/21.
//
#include "DSP.hpp"
#include <algorithm>
namespace ComSquare::APU::DSP
{
void DSP::voiceOutput(Voice &voice, bool channel)
{
int out = this->_latch.output * voice.volume[channel] >> 7;
this->_master.output[channel] += out;
if (!voice.echo)
return;
this->_echo.volume[channel] += out;
}
void DSP::voice1(Voice &voice)
{
}
void DSP::voice2(Voice &voice)
{
/*uint16_t addr = this->_brr.
this->_latch.adsr1 = voice.adsr1;*/
}
void DSP::voice3(Voice &voice)
{
}
void DSP::voice3a(Voice &voice)
{
}
void DSP::voice3b(Voice &voice)
{
}
void DSP::voice3c(Voice &voice)
{
}
void DSP::voice4(Voice &voice)
{
}
void DSP::voice5(Voice &voice)
{
this->voiceOutput(voice, 1);
voice.endx |= voice.loop;
if (voice.konDelay == 5)
voice.endx &= ~voice.endx;
}
void DSP::voice6(Voice &voice)
{
}
void DSP::voice7(Voice &voice)
{
}
void DSP::voice8(Voice &voice)
{
}
void DSP::voice9(Voice &voice)
{
}
}