diff --git a/src/engine/platform/msm6295.cpp b/src/engine/platform/msm6295.cpp index c2a15d2db..67e3390da 100644 --- a/src/engine/platform/msm6295.cpp +++ b/src/engine/platform/msm6295.cpp @@ -412,10 +412,18 @@ void DivPlatformMSM6295::renderSamples(int sysID) { // sample data size_t memPos=128*8; + int sampleCount=parent->song.sampleLen; if (isBanked) { + if (sampleCount>8191) { + // mark the rest as unavailable + for (int i=8191; isong.sampleLen; i++) { + for (int i=0; isong.sample[i]; if (!s->renderOn[0][sysID]) { sampleOffVOX[i]=0; @@ -455,7 +463,7 @@ void DivPlatformMSM6295::renderSamples(int sysID) { adpcmMemLen=memPos+256; // phrase book - for (int i=0; isong.sampleLen; i++) { + for (int i=0; isong.sampleLen; if (sampleCount>127) { // mark the rest as unavailable for (int i=127; i