diff options
author | Vitaly Novichkov <Wohlstand@users.noreply.github.com> | 2019-03-03 16:28:23 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-03 16:28:23 +0300 |
commit | c19bf11f4b12004051fc76651733e17f3e98143a (patch) | |
tree | db8c6030ffb2a5ae1ac18405ad5a570c8edc78bd | |
parent | 9b63225a5ebbf82e27229443b8912512e407ef99 (diff) | |
parent | ebc2b4a2a6914c069f879574c4d9b53fbb72f27e (diff) | |
download | libADLMIDI-c19bf11f4b12004051fc76651733e17f3e98143a.tar.gz libADLMIDI-c19bf11f4b12004051fc76651733e17f3e98143a.tar.bz2 libADLMIDI-c19bf11f4b12004051fc76651733e17f3e98143a.zip |
Merge pull request #215 from jpcima/work
fix uninitialized chip variables
-rw-r--r-- | src/chips/java/JavaOPL3.hpp | 2 | ||||
-rw-r--r-- | src/chips/opal/opal.hpp | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/chips/java/JavaOPL3.hpp b/src/chips/java/JavaOPL3.hpp index 17aff80..e9f0399 100644 --- a/src/chips/java/JavaOPL3.hpp +++ b/src/chips/java/JavaOPL3.hpp @@ -792,6 +792,8 @@ OPL3::~OPL3() void OPL3::initOperators() { + memset(registers, 0, sizeof(registers)); + int baseAddress; // The YMF262 has 36 operators: memset(operators, 0, sizeof(operators)); diff --git a/src/chips/opal/opal.hpp b/src/chips/opal/opal.hpp index 511760c..e8110a5 100644 --- a/src/chips/opal/opal.hpp +++ b/src/chips/opal/opal.hpp @@ -372,8 +372,11 @@ void Opal::Init(int sample_rate) { Op[i].ComputeRates(); // Initialise channel panning at center. - for (int i = 0; i < NumChannels; i++) + for (int i = 0; i < NumChannels; i++) { Chan[i].SetPan(64); + Chan[i].SetLeftEnable(true); + Chan[i].SetRightEnable(true); + } SetSampleRate(sample_rate); } |