mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Mostly restore the old code path
This commit is contained in:
parent
96ca0e95f3
commit
870995a767
3 changed files with 24 additions and 6 deletions
|
@ -946,10 +946,29 @@ int Atrac::DecodeLowLevel(const u8 *srcData, int *bytesConsumed, s16 *dstData, i
|
|||
return 0;
|
||||
}
|
||||
|
||||
void Atrac::CheckForSas() {
|
||||
SetOutputChannels(1);
|
||||
}
|
||||
|
||||
int Atrac::EnqueueForSas(u32 bufPtr, u32 bytesToAdd) {
|
||||
int addbytes = std::min(bytesToAdd, track_.fileSize - first_.fileoffset - track_.FirstOffsetExtra());
|
||||
Memory::Memcpy(dataBuf_ + first_.fileoffset + track_.FirstOffsetExtra(), bufPtr, addbytes, "AtracAddStreamData");
|
||||
first_.size += bytesToAdd;
|
||||
if (first_.size >= track_.fileSize) {
|
||||
first_.size = track_.fileSize;
|
||||
if (bufferState_ == ATRAC_STATUS_HALFWAY_BUFFER)
|
||||
bufferState_ = ATRAC_STATUS_ALL_DATA_LOADED;
|
||||
}
|
||||
first_.fileoffset += addbytes;
|
||||
// refresh context_
|
||||
WriteContextToPSPMem();
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Atrac::DecodeForSas(s16 *dstData, int *bytesWritten, int *finish) {
|
||||
// Disabled, can't work now that we changed the interface.
|
||||
*bytesWritten = 0;
|
||||
*finish = 1;
|
||||
// Hack, but works.
|
||||
int samplesNum;
|
||||
DecodeData((u8 *)dstData, 0, &samplesNum, finish, nullptr);
|
||||
}
|
||||
|
||||
void Atrac::NotifyGetContextAddress() {
|
||||
|
|
|
@ -231,8 +231,8 @@ public:
|
|||
u32 DecodeData(u8 *outbuf, u32 outbufPtr, int *SamplesNum, int *finish, int *remains) override;
|
||||
int DecodeLowLevel(const u8 *srcData, int *bytesConsumed, s16 *dstData, int *bytesWritten) override;
|
||||
|
||||
void CheckForSas() {}
|
||||
int EnqueueForSas(u32 address, u32 ptr) override { return 0; }
|
||||
void CheckForSas() override;
|
||||
int EnqueueForSas(u32 address, u32 ptr) override;
|
||||
void DecodeForSas(s16 *dstData, int *bytesWritten, int *finish) override;
|
||||
|
||||
// Returns how many samples the next DecodeData will write.
|
||||
|
|
|
@ -1138,7 +1138,6 @@ int AtracSasBindContextAndGetID(u32 contextAddr) {
|
|||
_dbg_assert_(atracID != -1);
|
||||
}
|
||||
|
||||
// Not actually a hack, this happens.
|
||||
AtracBase *atrac = getAtrac(atracID);
|
||||
atrac->CheckForSas();
|
||||
return atracID;
|
||||
|
|
Loading…
Add table
Reference in a new issue