Atrac: Also read loop count from context RAM.

Observed the Sol Trigger demo's library writing values here, although in
the cases I saw it wasn't changing it from 0.
This commit is contained in:
Unknown W. Brackets 2015-11-08 12:22:12 -08:00
parent 43238322ef
commit ac524eee1b

View file

@ -562,6 +562,7 @@ static Atrac *getAtrac(int atracID) {
// Read in any changes from the game to the context.
// TODO: Might be better to just always track in RAM.
atrac->bufferState = atrac->atracContext->info.state;
atrac->loopNum = atrac->atracContext->info.loopNum;
}
return atrac;
@ -1858,6 +1859,9 @@ static u32 sceAtracSetLoopNum(int atracID, int loopNum) {
atrac->loopStartSample = atrac->firstSampleoffset + atrac->firstOffsetExtra();
atrac->loopEndSample = atrac->endSample + atrac->firstSampleoffset + atrac->firstOffsetExtra();
}
if (atrac->atracContext.IsValid()) {
_AtracGenerateContext(atrac, atrac->atracContext);
}
}
return 0;
}