From e63b6d22ae8c1e895c77ce8eb4c4866ebb050ae4 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Thu, 14 Jan 2016 21:59:37 -0500 Subject: [PATCH] As shown by the commented-out code, the aliasing-adaptation seems to be working. So something is wrong somewhere else. --- Machines/Electron/Electron.cpp | 11 +++++++++++ Machines/Electron/Electron.hpp | 5 ++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Machines/Electron/Electron.cpp b/Machines/Electron/Electron.cpp index 1f4176edc..cd48d9f57 100644 --- a/Machines/Electron/Electron.cpp +++ b/Machines/Electron/Electron.cpp @@ -502,6 +502,7 @@ void Machine::Speaker::get_samples(unsigned int number_of_samples, int16_t *targ else { *target = _output_level; +// fwrite(target, sizeof(int16_t), 1, rawStream); } skip_samples(number_of_samples); } @@ -529,3 +530,13 @@ void Machine::Speaker::set_is_enabled(bool is_enabled) _is_enabled = is_enabled; _counter = 0; } + +Machine::Speaker::Speaker() : _counter(0), _divider(0x32), _is_enabled(false), _output_level(0) +{ +// rawStream = fopen("/Users/thomasharte/Desktop/sound.rom", "wb"); +} + +Machine::Speaker::~Speaker() +{ +// fclose(rawStream); +} diff --git a/Machines/Electron/Electron.hpp b/Machines/Electron/Electron.hpp index 8547f7ed2..24041cee2 100644 --- a/Machines/Electron/Electron.hpp +++ b/Machines/Electron/Electron.hpp @@ -106,7 +106,8 @@ class Machine: public CPU6502::Processor { void get_samples(unsigned int number_of_samples, int16_t *target); void skip_samples(unsigned int number_of_samples); - Speaker() : _counter(0), _divider(0x32), _is_enabled(false), _output_level(0) {} + Speaker(); + ~Speaker(); private: unsigned int _counter; @@ -114,6 +115,8 @@ class Machine: public CPU6502::Processor { bool _is_enabled; int16_t _output_level; +// FILE *rawStream; + } _speaker; };