Skip to content

Commit

Permalink
SegaPCM: fix sample offset moving loop
Browse files Browse the repository at this point in the history
issue #2306
  • Loading branch information
tildearrow committed Dec 29, 2024
1 parent 1b3a3c4 commit 5ffd47e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/engine/platform/segapcm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ void DivPlatformSegaPCM::tick(bool sysTick) {
if (!s->isLoopable()) {
rWrite(0x86+(i<<3),2+((actualPos>>16)<<3));
} else {
int loopPos=(actualPos&0xffff)+loopStart;
int loopPos=(sampleOffSegaPCM[chan[i].pcm.sample]&0xffff)+loopStart;
logV("sampleOff: %x loopPos: %x",actualPos,loopPos);
rWrite(4+(i<<3),loopPos&0xff);
rWrite(5+(i<<3),(loopPos>>8)&0xff);
Expand All @@ -165,7 +165,7 @@ void DivPlatformSegaPCM::tick(bool sysTick) {
if (!s->isLoopable()) {
rWrite(0x86+(i<<3),2+((actualPos>>16)<<3));
} else {
int loopPos=(actualPos&0xffff)+loopStart;
int loopPos=(sampleOffSegaPCM[chan[i].pcm.sample]&0xffff)+loopStart;
rWrite(4+(i<<3),loopPos&0xff);
rWrite(5+(i<<3),(loopPos>>8)&0xff);
rWrite(0x86+(i<<3),((actualPos>>16)<<3));
Expand Down

0 comments on commit 5ffd47e

Please sign in to comment.