1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-01-11 08:30:55 +00:00

Nudges the LowpassSpeaker towards supporting stereo generation.

This commit is contained in:
Thomas Harte 2020-02-15 18:03:12 -05:00
parent 743981e9ad
commit e02d109864
14 changed files with 23 additions and 19 deletions

View File

@ -433,7 +433,7 @@ template <class BusHandler> class MOS6560 {
Concurrency::DeferringAsyncTaskQueue audio_queue_;
AudioGenerator audio_generator_;
Outputs::Speaker::LowpassSpeaker<AudioGenerator> speaker_;
Outputs::Speaker::LowpassSpeaker<AudioGenerator, false> speaker_;
Cycles cycles_since_speaker_update_;
void update_audio() {

View File

@ -160,7 +160,7 @@ class AYDeferrer {
private:
Concurrency::DeferringAsyncTaskQueue audio_queue_;
GI::AY38910::AY38910 ay_;
Outputs::Speaker::LowpassSpeaker<GI::AY38910::AY38910> speaker_;
Outputs::Speaker::LowpassSpeaker<GI::AY38910::AY38910, false> speaker_;
HalfCycles cycles_since_update_;
};

View File

@ -108,7 +108,7 @@ template <Analyser::Static::AppleII::Target::Model model> class ConcreteMachine:
Concurrency::DeferringAsyncTaskQueue audio_queue_;
Audio::Toggle audio_toggle_;
Outputs::Speaker::LowpassSpeaker<Audio::Toggle> speaker_;
Outputs::Speaker::LowpassSpeaker<Audio::Toggle, false> speaker_;
Cycles cycles_since_audio_update_;
// MARK: - Cards

View File

@ -18,7 +18,7 @@ namespace Macintosh {
struct DeferredAudio {
Concurrency::DeferringAsyncTaskQueue queue;
Audio audio;
Outputs::Speaker::LowpassSpeaker<Audio> speaker;
Outputs::Speaker::LowpassSpeaker<Audio, false> speaker;
HalfCycles time_since_update;
DeferredAudio() : audio(queue), speaker(audio) {}

View File

@ -41,7 +41,7 @@ class Bus {
Concurrency::DeferringAsyncTaskQueue audio_queue_;
TIASound tia_sound_;
Outputs::Speaker::LowpassSpeaker<TIASound> speaker_;
Outputs::Speaker::LowpassSpeaker<TIASound, false> speaker_;
// joystick state
uint8_t tia_input_value_[2] = {0xff, 0xff};

View File

@ -498,7 +498,7 @@ class ConcreteMachine:
Concurrency::DeferringAsyncTaskQueue audio_queue_;
GI::AY38910::AY38910 ay_;
Outputs::Speaker::LowpassSpeaker<GI::AY38910::AY38910> speaker_;
Outputs::Speaker::LowpassSpeaker<GI::AY38910::AY38910, false> speaker_;
HalfCycles cycles_since_audio_update_;
JustInTimeActor<DMAController> dma_;

View File

@ -407,7 +407,7 @@ class ConcreteMachine:
TI::SN76489 sn76489_;
GI::AY38910::AY38910 ay_;
Outputs::Speaker::CompoundSource<TI::SN76489, GI::AY38910::AY38910> mixer_;
Outputs::Speaker::LowpassSpeaker<Outputs::Speaker::CompoundSource<TI::SN76489, GI::AY38910::AY38910>> speaker_;
Outputs::Speaker::LowpassSpeaker<Outputs::Speaker::CompoundSource<TI::SN76489, GI::AY38910::AY38910>, false> speaker_;
std::vector<uint8_t> bios_;
std::vector<uint8_t> cartridge_;

View File

@ -592,7 +592,7 @@ class ConcreteMachine:
Concurrency::DeferringAsyncTaskQueue audio_queue_;
SoundGenerator sound_generator_;
Outputs::Speaker::LowpassSpeaker<SoundGenerator> speaker_;
Outputs::Speaker::LowpassSpeaker<SoundGenerator, false> speaker_;
bool speaker_is_enabled_ = false;

View File

@ -764,7 +764,7 @@ class ConcreteMachine:
Audio::Toggle audio_toggle_;
Konami::SCC scc_;
Outputs::Speaker::CompoundSource<GI::AY38910::AY38910, Audio::Toggle, Konami::SCC> mixer_;
Outputs::Speaker::LowpassSpeaker<Outputs::Speaker::CompoundSource<GI::AY38910::AY38910, Audio::Toggle, Konami::SCC>> speaker_;
Outputs::Speaker::LowpassSpeaker<Outputs::Speaker::CompoundSource<GI::AY38910::AY38910, Audio::Toggle, Konami::SCC>, false> speaker_;
Storage::Tape::BinaryTapePlayer tape_player_;
bool tape_player_is_sleeping_ = false;

View File

@ -424,7 +424,7 @@ class ConcreteMachine:
Concurrency::DeferringAsyncTaskQueue audio_queue_;
TI::SN76489 sn76489_;
Outputs::Speaker::LowpassSpeaker<TI::SN76489> speaker_;
Outputs::Speaker::LowpassSpeaker<TI::SN76489, false> speaker_;
std::vector<std::unique_ptr<Inputs::Joystick>> joysticks_;
Inputs::Keyboard keyboard_;

View File

@ -43,6 +43,7 @@
namespace Oric {
using DiskInterface = Analyser::Static::Oric::Target::DiskInterface;
using Speaker = Outputs::Speaker::LowpassSpeaker<GI::AY38910::AY38910, false>;
enum ROM {
BASIC10 = 0, BASIC11, Microdisc, Colour
@ -146,7 +147,7 @@ class TapePlayer: public Storage::Tape::BinaryTapePlayer {
*/
class VIAPortHandler: public MOS::MOS6522::IRQDelegatePortHandler {
public:
VIAPortHandler(Concurrency::DeferringAsyncTaskQueue &audio_queue, GI::AY38910::AY38910 &ay8910, Outputs::Speaker::LowpassSpeaker<GI::AY38910::AY38910> &speaker, TapePlayer &tape_player, Keyboard &keyboard) :
VIAPortHandler(Concurrency::DeferringAsyncTaskQueue &audio_queue, GI::AY38910::AY38910 &ay8910, Speaker &speaker, TapePlayer &tape_player, Keyboard &keyboard) :
audio_queue_(audio_queue), ay8910_(ay8910), speaker_(speaker), tape_player_(tape_player), keyboard_(keyboard) {}
/*!
@ -210,7 +211,7 @@ class VIAPortHandler: public MOS::MOS6522::IRQDelegatePortHandler {
Concurrency::DeferringAsyncTaskQueue &audio_queue_;
GI::AY38910::AY38910 &ay8910_;
Outputs::Speaker::LowpassSpeaker<GI::AY38910::AY38910> &speaker_;
Speaker &speaker_;
TapePlayer &tape_player_;
Keyboard &keyboard_;
};
@ -692,7 +693,7 @@ template <Analyser::Static::Oric::Target::DiskInterface disk_interface> class Co
Concurrency::DeferringAsyncTaskQueue audio_queue_;
GI::AY38910::AY38910 ay8910_;
Outputs::Speaker::LowpassSpeaker<GI::AY38910::AY38910> speaker_;
Speaker speaker_;
// Inputs
Oric::KeyboardMapper keyboard_mapper_;

View File

@ -468,7 +468,7 @@ template<bool is_zx81> class ConcreteMachine:
// MARK: - Audio
Concurrency::DeferringAsyncTaskQueue audio_queue_;
GI::AY38910::AY38910 ay_;
Outputs::Speaker::LowpassSpeaker<GI::AY38910::AY38910> speaker_;
Outputs::Speaker::LowpassSpeaker<GI::AY38910::AY38910, false> speaker_;
HalfCycles time_since_ay_update_;
inline void ay_set_register(uint8_t value) {
update_audio();

View File

@ -58,6 +58,10 @@
</CommandLineArgument>
<CommandLineArgument
argument = "&quot;/Users/thomasharte/Library/Mobile Documents/com~apple~CloudDocs/Desktop/Soft/Master System/R-Type (NTSC).sms&quot;"
isEnabled = "NO">
</CommandLineArgument>
<CommandLineArgument
argument = "&quot;/Users/thomasharte/Library/Mobile Documents/com~apple~CloudDocs/Desktop/Soft/Amstrad CPC/Robocop.dsk&quot;"
isEnabled = "YES">
</CommandLineArgument>
<CommandLineArgument

View File

@ -28,9 +28,9 @@ namespace Speaker {
source of a high-frequency stream of audio which it filters down to a
lower-frequency output.
*/
template <typename T> class LowpassSpeaker: public Speaker {
template <typename SampleSource, bool is_stereo> class LowpassSpeaker: public Speaker {
public:
LowpassSpeaker(T &sample_source) : sample_source_(sample_source) {
LowpassSpeaker(SampleSource &sample_source) : sample_source_(sample_source) {
sample_source.set_sample_volume_range(32767);
}
@ -69,9 +69,8 @@ template <typename T> class LowpassSpeaker: public Speaker {
output_buffer_.resize(std::size_t(buffer_size));
}
// TODO.
bool get_is_stereo() final {
return false;
return is_stereo;
}
/*!
@ -179,7 +178,7 @@ template <typename T> class LowpassSpeaker: public Speaker {
}
}
T &sample_source_;
SampleSource &sample_source_;
std::size_t output_buffer_pointer_ = 0;
std::size_t input_buffer_depth_ = 0;