WaveSynth: initialize wave to 0 on SCC/Bubble Syst

This commit is contained in:
tildearrow 2022-06-09 18:16:51 -05:00
parent eac4f50d92
commit dd05429c0e
4 changed files with 9 additions and 4 deletions

View File

@ -306,7 +306,7 @@ void DivPlatformBubSysWSG::reset() {
for (int i=0; i<2; i++) {
chan[i]=DivPlatformBubSysWSG::Channel();
chan[i].std.setEngine(parent);
chan[i].ws.setEngine(parent);
chan[i].ws.setEngine(parent,8);
chan[i].ws.init(NULL,32,15,false);
}
if (dumpWrites) {

View File

@ -332,7 +332,7 @@ void DivPlatformSCC::reset() {
for (int i=0; i<5; i++) {
chan[i]=DivPlatformSCC::Channel();
chan[i].std.setEngine(parent);
chan[i].ws.setEngine(parent);
chan[i].ws.setEngine(parent,128);
chan[i].ws.init(NULL,32,255,false);
chan[i].vol=15;
chan[i].outVol=15;

View File

@ -243,8 +243,13 @@ void DivWaveSynth::changeWave2(int num) {
first=true;
}
void DivWaveSynth::setEngine(DivEngine* engine) {
void DivWaveSynth::setEngine(DivEngine* engine, int waveFloor) {
e=engine;
memset(wave1,waveFloor,256);
memset(wave2,waveFloor,256);
for (int i=0; i<256; i++) {
output[i]=waveFloor;
}
}
void DivWaveSynth::init(DivInstrument* which, int w, int h, bool insChanged) {

View File

@ -70,7 +70,7 @@ class DivWaveSynth {
* @param insChanged whether the instrument has changed.
*/
void init(DivInstrument* which, int width, int height, bool insChanged=false);
void setEngine(DivEngine* engine);
void setEngine(DivEngine* engine, int waveFloor=0);
DivWaveSynth():
e(NULL),
pos(0),