diff options
author | 2022-04-03 02:53:19 +1000 | |
---|---|---|
committer | 2022-04-03 02:53:19 +1000 | |
commit | c4f9ff9790382c1c5b99a2ffbb2a14e04d4c7cea (patch) | |
tree | 80a1185e2dbed843500eda4e740dfac9f03eba1b /src/devices/sound/sidvoice.h | |
parent | 5255f96203e4dc58ba660f74a64e6b640016a604 (diff) |
-util/corealloc.h: Reduced make_unique_clear to a single variant for POD arrays.
* Enabled GCC lifetime dead store elimination optimisation.
* emu/device.h: Don't pre-clear memory for drivers. Ivan Vangelista
fixed at least the majority of things that crashed outright, and
Robbbert initialised variables that coverity complained about. It's
unlikely anything will break due to this.
* sound/discrete.h: Explicitly initialise members of discrete "devices"
to zero. I don't see a way around doing this in headers due to the
macro soup used to build the constructors.
* sound/mos6581.cpp: Moved creation of the SID core to device_start and
explictly initialised members of the SID core structures. These
structures are in internal headers, so they won't cause downstream
recompiles.
-Lua engine: Made I/O port manager type_seq a bit more tolerant of
omitted arguments.
Diffstat (limited to 'src/devices/sound/sidvoice.h')
-rw-r--r-- | src/devices/sound/sidvoice.h | 82 |
1 files changed, 41 insertions, 41 deletions
diff --git a/src/devices/sound/sidvoice.h b/src/devices/sound/sidvoice.h index 173b5c070fd..7b555d6dd3f 100644 --- a/src/devices/sound/sidvoice.h +++ b/src/devices/sound/sidvoice.h @@ -16,81 +16,81 @@ struct sidOperator { struct sw_storage { - uint16_t len; + uint16_t len = 0; #if defined(DIRECT_FIXPOINT) - uint32_t stp; + uint32_t stp = 0; #else - uint32_t pnt; - int16_t stp; + uint32_t pnt = 0; + int16_t stp = 0; #endif }; - SID6581_t *sid; - uint8_t reg[7]; - uint32_t SIDfreq; - uint16_t SIDpulseWidth; - uint8_t SIDctrl; - uint8_t SIDAD, SIDSR; + SID6581_t *sid = nullptr; + uint8_t reg[7]{ 0 }; + uint32_t SIDfreq = 0; + uint16_t SIDpulseWidth = 0; + uint8_t SIDctrl = 0; + uint8_t SIDAD = 0, SIDSR = 0; - sidOperator* carrier; - sidOperator* modulator; - int sync; + sidOperator *carrier = nullptr; + sidOperator *modulator = nullptr; + int sync = 0; - uint16_t pulseIndex, newPulseIndex; - uint16_t curSIDfreq; - uint16_t curNoiseFreq; + uint16_t pulseIndex = 0, newPulseIndex = 0; + uint16_t curSIDfreq = 0; + uint16_t curNoiseFreq = 0; - uint8_t output;//, outputMask; + uint8_t output = 0/*, outputMask = 0*/; - char filtVoiceMask; - int filtEnabled; - float filtLow, filtRef; - int8_t filtIO; + char filtVoiceMask = 0; + int filtEnabled = 0; + float filtLow = 0, filtRef = 0; + int8_t filtIO = 0; - int32_t cycleLenCount; + int32_t cycleLenCount = 0; #if defined(DIRECT_FIXPOINT) PAIR cycleLen, cycleAddLen; #else - uint32_t cycleAddLenPnt; - uint16_t cycleLen, cycleLenPnt; + uint32_t cycleAddLenPnt = 0; + uint16_t cycleLen, cycleLenPnt = 0; #endif - int8_t (*outProc)(sidOperator *); - void (*waveProc)(sidOperator *); + int8_t (*outProc)(sidOperator *) = nullptr; + void (*waveProc)(sidOperator *) = nullptr; #if defined(DIRECT_FIXPOINT) PAIR waveStep, waveStepAdd; #else - uint16_t waveStep, waveStepAdd; - uint32_t waveStepPnt, waveStepAddPnt; + uint16_t waveStep = 0, waveStepAdd = 0; + uint32_t waveStepPnt = 0, waveStepAddPnt = 0; #endif - uint16_t waveStepOld; + uint16_t waveStepOld = 0; sw_storage wavePre[2]; #if defined(DIRECT_FIXPOINT) PAIR noiseReg; #else - uint32_t noiseReg; + uint32_t noiseReg = 0; #endif - uint32_t noiseStep, noiseStepAdd; - uint8_t noiseOutput; - int noiseIsLocked; + uint32_t noiseStep = 0, noiseStepAdd = 0; + uint8_t noiseOutput = 0; + int noiseIsLocked = 0; - uint8_t ADSRctrl; + uint8_t ADSRctrl = 0; // int gateOnCtrl, gateOffCtrl; - uint16_t (*ADSRproc)(sidOperator *); + uint16_t (*ADSRproc)(sidOperator *) = nullptr; #ifdef SID_FPUENVE - float fenveStep, fenveStepAdd; - uint32_t enveStep; + float fenveStep = 0.0, fenveStepAdd = 0.0; + uint32_t enveStep = 0; #elif defined(DIRECT_FIXPOINT) PAIR enveStep, enveStepAdd; #else - uint16_t enveStep, enveStepAdd; - uint32_t enveStepPnt, enveStepAddPnt; + uint16_t enveStep = 0, enveStepAdd = 0; + uint32_t enveStepPnt = 0, enveStepAddPnt = 0; #endif - uint8_t enveVol, enveSusVol; - uint16_t enveShortAttackCount; + uint8_t enveVol = 0, enveSusVol = 0; + uint16_t enveShortAttackCount = 0; void clear(); |