|
ComSquare
|
#include <DSP.hpp>
Public Member Functions | |
| DSP (Renderer::IRenderer &renderer, MemoryMap &map) | |
| DSP (const DSP &)=default | |
| DSP & | operator= (const DSP &)=delete |
| ~DSP ()=default | |
| const std::array< Voice, 8 > & | getVoices () const |
| Return all 8 voices from DSP. More... | |
| const Master & | getMaster () const |
| const Echo & | getEcho () const |
| const Noise & | getNoise () const |
| const BRR & | getBrr () const |
| const Latch & | getLatch () const |
| uint8_t | read (uint24_t addr) const |
| Read from the internal DSP register. More... | |
| void | write (uint24_t addr, uint8_t data) |
| Write data to the internal DSP register. More... | |
| std::string | getName () const |
| Get the name of this accessor (used for debug purpose) More... | |
| void | update () |
| Execute current voice transformation. More... | |
| Component | getComponent () const |
| Get the component of this accessor (used for debug purpose) More... | |
| uint24_t | getSize () const |
| Get the size of the data. This size can be lower than the mapped data. More... | |
| int32_t | getSamplesCount () const |
| Return the number of samples written. More... | |
Private Member Functions | |
| void | voiceOutput (Voice &voice, bool channel) |
| void | voice1 (Voice &voice) |
| void | voice2 (Voice &voice) |
| void | voice3 (Voice &voice) |
| void | voice3a (Voice &voice) |
| void | voice3b (Voice &voice) |
| void | voice3c (Voice &voice) |
| void | voice4 (Voice &voice) |
| void | voice5 (Voice &voice) |
| void | voice6 (Voice &voice) |
| void | voice7 (Voice &voice) |
| void | voice8 (Voice &voice) |
| void | voice9 (Voice &voice) |
| void | echo22 () |
| void | echo23 () |
| void | echo24 () |
| void | echo25 () |
| void | echo26 () |
| void | echo27 () |
| void | echo28 () |
| void | echo29 () |
| void | echo30 () |
| void | misc27 () |
| void | misc28 () |
| void | misc29 () |
| void | misc30 () |
| int32_t | interpolate (const Voice &voice) |
| Interpolate voice samples with gauss table. More... | |
| void | runEnvelope (Voice &voice) |
| Modify voice samples with its envelope. More... | |
| int32_t | loadFIR (bool channel, int fir) |
| void | loadEcho (bool channel) |
| int16_t | outputEcho (bool channel) |
| void | writeEcho (bool channel) |
| void | timerTick () |
| Remove one tick from timer. More... | |
| bool | timerPoll (uint32_t rate) |
| Check if timer value is equal to rate value. More... | |
| void | decodeBRR (Voice &voice) |
| Transform BRR value to samples. More... | |
| uint8_t | _readRAM (uint24_t addr) |
| Read inside APU RAM. More... | |
| void | _writeRAM (uint24_t addr, uint8_t data) |
| Write into APU RAM. More... | |
Private Attributes | |
| std::array< uint16_t, 32 > | _rateModulus |
| Number of samples per counter event. More... | |
| std::array< uint16_t, 32 > | _counterOffset |
| Counter offset. More... | |
| std::array< int16_t, 512 > | _gauss |
| Gaussian table used for making waves. More... | |
| std::array< int16_t, 0x10000 > | _soundBuffer = {} |
| Buffer containing samples to be played. More... | |
| std::array< Voice, 8 > | _voices {} |
| 8x voices of sample used to make sound More... | |
| Master | _master {} |
| Echo | _echo {} |
| Noise | _noise {} |
| BRR | _brr {} |
| Latch | _latch {} |
| State | _state |
| Timer | _timer {} |
| MemoryMap & | _map |
| Whole APU RAM map. More... | |
| Renderer::IRenderer & | _renderer |
| Renderer used to play sounds. More... | |
| ComSquare::APU::DSP::DSP::DSP | ( | Renderer::IRenderer & | renderer, |
| MemoryMap & | map | ||
| ) |
|
default |
|
default |
|
private |
Write into APU RAM.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
| const BRR & ComSquare::APU::DSP::DSP::getBrr | ( | ) | const |
| Component ComSquare::APU::DSP::DSP::getComponent | ( | ) | const |
Get the component of this accessor (used for debug purpose)
| const Echo & ComSquare::APU::DSP::DSP::getEcho | ( | ) | const |
| const Latch & ComSquare::APU::DSP::DSP::getLatch | ( | ) | const |
| const Master & ComSquare::APU::DSP::DSP::getMaster | ( | ) | const |
| std::string ComSquare::APU::DSP::DSP::getName | ( | ) | const |
Get the name of this accessor (used for debug purpose)
| const Noise & ComSquare::APU::DSP::DSP::getNoise | ( | ) | const |
| int32_t ComSquare::APU::DSP::DSP::getSamplesCount | ( | ) | const |
Return the number of samples written.
| uint24_t ComSquare::APU::DSP::DSP::getSize | ( | ) | const |
Get the size of the data. This size can be lower than the mapped data.
| const std::array< Voice, 8 > & ComSquare::APU::DSP::DSP::getVoices | ( | ) | const |
Return all 8 voices from DSP.
|
private |
Interpolate voice samples with gauss table.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
| uint8_t ComSquare::APU::DSP::DSP::read | ( | uint24_t | addr | ) | const |
Read from the internal DSP register.
| addr | The address to read from. The address 0x0 should refer to the first byte of the register. |
| InvalidAddress | will be thrown if the address is more than $7F (the number of register). |
|
private |
Modify voice samples with its envelope.
|
private |
Check if timer value is equal to rate value.
|
private |
Remove one tick from timer.
| void ComSquare::APU::DSP::DSP::update | ( | ) |
Execute current voice transformation.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
| void ComSquare::APU::DSP::DSP::write | ( | uint24_t | addr, |
| uint8_t | data | ||
| ) |
Write data to the internal DSP register.
| addr | The address to write to. The address 0x0 should refer to the first byte of register. |
| data | The new value of the register. |
| InvalidAddress | will be thrown if the address is more than $7F (the number of register). |
|
private |
|
private |
|
private |
Counter offset.
|
private |
|
private |
Gaussian table used for making waves.
|
private |
|
private |
|
private |
|
private |
Number of samples per counter event.
|
private |
Renderer used to play sounds.
|
private |
Buffer containing samples to be played.
|
private |
|
private |
|
private |
8x voices of sample used to make sound
1.8.17