mirror of
https://github.com/zoriya/ComSquare.git
synced 2026-05-28 00:31:38 +00:00
Merge branch 'master' of https://github.com/AnonymusRaccoon/ComSquare
This commit is contained in:
@@ -45,6 +45,9 @@ add_executable(unit_tests
|
||||
target_link_libraries(unit_tests criterion -lgcov)
|
||||
target_compile_options(unit_tests PUBLIC -fprofile-arcs -ftest-coverage)
|
||||
|
||||
#include SFML
|
||||
add_link_options(-lsfml-graphics -lsfml-window -lsfml-audio -lsfml-network -lsfml-system)
|
||||
|
||||
# make app
|
||||
add_executable(ComSquare
|
||||
main.cpp
|
||||
|
||||
+2
-2
@@ -106,9 +106,9 @@ namespace ComSquare::APU
|
||||
class APU : public Memory::IMemory {
|
||||
private:
|
||||
//! @brief All the registers of the APU CPU
|
||||
Registers _registers;
|
||||
Registers _registers{};
|
||||
//! @brief Internal registers of the CPU (accessible from the bus via addr $4200 to $421F).
|
||||
InternalRegisters _internalRegisters;
|
||||
InternalRegisters _internalRegisters{};
|
||||
|
||||
//! @brief The DSP component used to produce sound
|
||||
std::shared_ptr<DSP::DSP> _dsp;
|
||||
|
||||
+7
-1
@@ -8,7 +8,13 @@
|
||||
namespace ComSquare::APU::DSP
|
||||
{
|
||||
DSP::DSP()
|
||||
{ }
|
||||
{
|
||||
for (auto & _channel : this->_channels) {
|
||||
_channel.setBuffer(this->_soundBuffer);
|
||||
_channel.setLoop(true);
|
||||
_channel.play();
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t DSP::read(uint24_t addr)
|
||||
{
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#define COMSQUARE_DSP_HPP
|
||||
|
||||
#include <cstdint>
|
||||
#include <SFML/Audio.hpp>
|
||||
#include "../Memory/IMemory.hpp"
|
||||
|
||||
namespace ComSquare::APU::DSP
|
||||
@@ -155,7 +156,14 @@ namespace ComSquare::APU::DSP
|
||||
|
||||
class DSP : public Memory::IMemory {
|
||||
private:
|
||||
//! @brief All registers of the DSP
|
||||
Registers _registers{};
|
||||
|
||||
//! @brief 8x channels of sample used to make sound
|
||||
sf::Sound _channels[8];
|
||||
|
||||
//! @brief A buffer containing current wave
|
||||
sf::SoundBuffer _soundBuffer;
|
||||
public:
|
||||
explicit DSP();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user