Atrac: fix loading certain savestates.

Some worked with it that high, but others not.
This commit is contained in:
Unknown W. Brackets 2015-10-10 18:14:23 -07:00
parent 5177f16c8d
commit b47458eabb

View File

@ -188,7 +188,7 @@ struct Atrac {
dataOff = firstSampleoffset;
}
u32 has_data_buf = data_buf != NULL;
u32 has_data_buf = data_buf != nullptr;
p.Do(has_data_buf);
if (has_data_buf) {
if (p.mode == p.MODE_READ) {
@ -198,9 +198,6 @@ struct Atrac {
}
p.DoArray(data_buf, first.filesize);
}
if (p.mode == p.MODE_READ && data_buf != NULL) {
__AtracSetContext(this);
}
p.Do(second);
p.Do(decodePos);
@ -222,6 +219,11 @@ struct Atrac {
p.Do(loopNum);
p.Do(atracContext);
// Make sure to do this late; it depends on things like atracBytesPerFrame.
if (p.mode == p.MODE_READ && data_buf != nullptr) {
__AtracSetContext(this);
}
if (s >= 2)
p.Do(resetBuffer);