SNES: fix sample end

This commit is contained in:
tildearrow 2022-09-25 01:42:59 -05:00
parent d78b1cb79a
commit ffa0181704
2 changed files with 2 additions and 2 deletions

View file

@ -60,7 +60,7 @@ long brrEncode(short* buf, unsigned char* out, long len, long loopStart) {
if (s<0) s=-s;
while (range<12 && s>((8<<range)-1)) range++;
}
next[0]=(range<<4)|(filter<<2)|((i+16>len)?1:0);
next[0]=(range<<4)|(filter<<2)|((i+16>=len)?1:0);
switch (filter) {
case 0:
for (int j=0; j<16; j++) {

View file

@ -912,7 +912,7 @@ void DivSample::render() {
if (depth!=DIV_SAMPLE_DEPTH_BRR) { // BRR
if (!initInternal(DIV_SAMPLE_DEPTH_BRR,samples)) return;
// TODO: loop point
brrEncode(data16,dataBRR,samples,0);
brrEncode(data16,dataBRR,(samples+15)&(~15),0);
}
if (depth!=DIV_SAMPLE_DEPTH_VOX) { // VOX
if (!initInternal(DIV_SAMPLE_DEPTH_VOX,samples)) return;