aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/adlmidi.cpp3
-rw-r--r--src/dbopl.cpp17
-rw-r--r--src/dbopl.h2
3 files changed, 20 insertions, 2 deletions
diff --git a/src/adlmidi.cpp b/src/adlmidi.cpp
index 6372f55..265208b 100644
--- a/src/adlmidi.cpp
+++ b/src/adlmidi.cpp
@@ -429,8 +429,7 @@ struct OPL3
{
LogarithmicVolumes = false;
#ifdef ADLMIDI_USE_DOSBOX_OPL
- DBOPL::Handler emptyChip;
- memset(&emptyChip, 0, sizeof(DBOPL::Handler));
+ DBOPL::Handler emptyChip; //Constructors inside are will initialize necessary fields
#else
_opl3_chip emptyChip;
memset(&emptyChip, 0, sizeof(_opl3_chip));
diff --git a/src/dbopl.cpp b/src/dbopl.cpp
index 1f2f397..e534c99 100644
--- a/src/dbopl.cpp
+++ b/src/dbopl.cpp
@@ -1203,6 +1203,23 @@ namespace DBOPL
regBD = 0;
reg104 = 0;
opl3Active = 0;
+ //Extra zeros!
+ vibratoIndex = 0;
+ tremoloIndex = 0;
+ vibratoSign = 0;
+ vibratoShift = 0;
+ tremoloValue = 0;
+ vibratoStrength = 0;
+ tremoloStrength = 0;
+ waveFormMask = 0;
+ lfoCounter = 0;
+ lfoAdd = 0;
+ noiseCounter = 0;
+ noiseAdd = 0;
+ noiseValue = 0;
+ memset(freqMul, 0, sizeof(Bit32u) * 16);
+ memset(linearRates, 0, sizeof(Bit32u) * 76);
+ memset(attackRates, 0, sizeof(Bit32u) * 76);
}
INLINE Bit32u Chip::ForwardNoise()
diff --git a/src/dbopl.h b/src/dbopl.h
index 5dfe7fe..bdd439d 100644
--- a/src/dbopl.h
+++ b/src/dbopl.h
@@ -173,6 +173,7 @@ namespace DBOPL
Bits GetWave(Bitu index, Bitu vol);
public:
Operator();
+ char ____padding[5];
};
struct Channel
@@ -211,6 +212,7 @@ namespace DBOPL
template<SynthMode mode>
Channel *BlockTemplate(Chip *chip, Bit32u samples, Bit32s *output);
Channel();
+ char ____padding[6];
};
struct Chip