SNES: fix sample offset not working at the end
This commit is contained in:
parent
d3eb5a2db5
commit
6a7e7ba571
|
|
@ -221,7 +221,7 @@ void DivPlatformSNES::tick(bool sysTick) {
|
||||||
end=MIN(start+MAX(s->lengthBRR+((s->loop && s->depth!=DIV_SAMPLE_DEPTH_BRR)?9:0),1),getSampleMemCapacity());
|
end=MIN(start+MAX(s->lengthBRR+((s->loop && s->depth!=DIV_SAMPLE_DEPTH_BRR)?9:0),1),getSampleMemCapacity());
|
||||||
loop=MAX(start,end-1);
|
loop=MAX(start,end-1);
|
||||||
if (chan[i].audPos>0) {
|
if (chan[i].audPos>0) {
|
||||||
start=start+MIN(chan[i].audPos,s->lengthBRR-1)/16*9;
|
start=start+MIN(chan[i].audPos/16*9,end-start);
|
||||||
}
|
}
|
||||||
if (s->isLoopable()) {
|
if (s->isLoopable()) {
|
||||||
loop=((s->depth!=DIV_SAMPLE_DEPTH_BRR)?9:0)+start+((s->loopStart/16)*9);
|
loop=((s->depth!=DIV_SAMPLE_DEPTH_BRR)?9:0)+start+((s->loopStart/16)*9);
|
||||||
|
|
@ -463,7 +463,6 @@ int DivPlatformSNES::dispatch(DivCommand c) {
|
||||||
chan[c.chan].inPorta=c.value;
|
chan[c.chan].inPorta=c.value;
|
||||||
break;
|
break;
|
||||||
case DIV_CMD_SAMPLE_POS:
|
case DIV_CMD_SAMPLE_POS:
|
||||||
// may have to remove this
|
|
||||||
chan[c.chan].audPos=c.value;
|
chan[c.chan].audPos=c.value;
|
||||||
chan[c.chan].setPos=true;
|
chan[c.chan].setPos=true;
|
||||||
break;
|
break;
|
||||||
|
|
@ -933,7 +932,6 @@ const void* DivPlatformSNES::getSampleMem(int index) {
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t DivPlatformSNES::getSampleMemCapacity(int index) {
|
size_t DivPlatformSNES::getSampleMemCapacity(int index) {
|
||||||
// TODO change it based on current echo buffer size
|
|
||||||
return index == 0 ? (65536-echoDelay*2048) : 0;
|
return index == 0 ? (65536-echoDelay*2048) : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue