PCE: the adventures of missing wavetables

This commit is contained in:
tildearrow 2021-06-08 22:21:05 -05:00
parent cd1851606e
commit 5b2684b5e1
1 changed files with 7 additions and 1 deletions

View File

@ -652,7 +652,13 @@ DivInstrument* DivEngine::getIns(int index) {
}
DivWavetable* DivEngine::getWave(int index) {
if (index<0 || index>=song.waveLen) return &song.nullWave;
if (index<0 || index>=song.waveLen) {
if (song.waveLen>0) {
return song.wave[0];
} else {
return &song.nullWave;
}
}
return song.wave[index];
}