(12*sampleBank+c.value%12)

This commit is contained in:
tildearrow 2022-10-04 00:46:16 -05:00
parent 4695659ae4
commit d981e59c59
4 changed files with 4 additions and 2 deletions

View file

@ -776,6 +776,7 @@ void DivPlatformAY8910::setFlags(const DivConfig& flags) {
if (extMode) {
chipClock=extClock;
rate=chipClock/extDiv;
clockSel=false;
} else {
clockSel=flags.getBool("halfClock",false);
switch (flags.getInt("clockSel",0)) {

View file

@ -167,7 +167,7 @@ int DivPlatformMSM6258::dispatch(DivCommand c) {
chan[c.chan].sample=-1;
chan[c.chan].macroInit(NULL);
chan[c.chan].outVol=chan[c.chan].vol;
if ((12*sampleBank+c.value%12)>=parent->song.sampleLen) {
if ((12*sampleBank+c.value%12)<0 || (12*sampleBank+c.value%12)>=parent->song.sampleLen) {
break;
}
//DivSample* s=parent->getSample(12*sampleBank+c.value%12);

View file

@ -158,7 +158,7 @@ int DivPlatformMSM6295::dispatch(DivCommand c) {
chan[c.chan].sample=-1;
chan[c.chan].macroInit(NULL);
chan[c.chan].outVol=chan[c.chan].vol;
if ((12*sampleBank+c.value%12)>=parent->song.sampleLen) {
if ((12*sampleBank+c.value%12)<0 || (12*sampleBank+c.value%12)>=parent->song.sampleLen) {
break;
}
//DivSample* s=parent->getSample(12*sampleBank+c.value%12);

View file

@ -561,6 +561,7 @@ int DivPlatformX1_010::dispatch(DivCommand c) {
} else {
chan[c.chan].macroInit(NULL);
chan[c.chan].outVol=chan[c.chan].vol;
// huh?
if ((12*sampleBank+c.value%12)>=parent->song.sampleLen) {
chWrite(c.chan,0,0); // reset
chWrite(c.chan,1,0);