RF5C68: 32

issue #1067
This commit is contained in:
tildearrow 2023-04-16 14:54:58 -05:00
parent 41cbdf7924
commit 6dc88143f3

View file

@ -151,8 +151,8 @@ void DivPlatformRF5C68::tick(bool sysTick) {
if (s->isLoopable()) { if (s->isLoopable()) {
loop=start+s->loopStart; loop=start+s->loopStart;
} }
start=MIN(start,getSampleMemCapacity()-31); start=MIN(start,getSampleMemCapacity()-32);
loop=MIN(loop,getSampleMemCapacity()-31); loop=MIN(loop,getSampleMemCapacity()-32);
rWrite(8,keyoff); // force keyoff first rWrite(8,keyoff); // force keyoff first
chWrite(i,6,start>>8); chWrite(i,6,start>>8);
chWrite(i,4,loop&0xff); chWrite(i,4,loop&0xff);
@ -425,7 +425,7 @@ void DivPlatformRF5C68::renderSamples(int sysID) {
} }
int length=s->getLoopEndPosition(DIV_SAMPLE_DEPTH_8BIT); int length=s->getLoopEndPosition(DIV_SAMPLE_DEPTH_8BIT);
int actualLength=MIN((int)(getSampleMemCapacity()-memPos)-31,length); int actualLength=MIN((int)(getSampleMemCapacity()-memPos)-32,length);
if (actualLength>0) { if (actualLength>0) {
sampleOffRFC[i]=memPos; sampleOffRFC[i]=memPos;
for (int j=0; j<actualLength; j++) { for (int j=0; j<actualLength; j++) {
@ -435,8 +435,8 @@ void DivPlatformRF5C68::renderSamples(int sysID) {
sampleMem[memPos++]=(val>0)?(val|0x80):(0-val); sampleMem[memPos++]=(val>0)?(val|0x80):(0-val);
} }
// write end of sample marker // write end of sample marker
memset(&sampleMem[memPos],0xff,31); memset(&sampleMem[memPos],0xff,32);
memPos+=31; memPos+=32;
} }
if (actualLength<length) { if (actualLength<length) {
logW("out of RF5C68 PCM memory for sample %d!",i); logW("out of RF5C68 PCM memory for sample %d!",i);