-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Few more updates to sceAtracGetSoundSample() & sceAtracGetSecondBuffe…
…rInfo
- Loading branch information
raven02
committed
Apr 16, 2013
1 parent
b9b01cc
commit fd1bc40
Showing
1 changed file
with
14 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -454,10 +454,10 @@ u32 sceAtracGetNextDecodePosition(int atracID, u32 outposAddr) | |
if (!atrac) { | ||
//return -1; | ||
} | ||
if (atrac->currentSample >= atrac->endSample) | ||
if (atrac->first.writableBytes - atrac->firstSampleoffset < atrac->atracBytesPerFrame || atrac->endSample < atrac->decodePos) | ||
return ATRAC_ERROR_ALL_DATA_DECODED; | ||
Memory::Write_U32(atrac->currentSample, outposAddr); // outpos | ||
return 0; | ||
Memory::Write_U32(atrac->decodePos - atrac->currentSample, outposAddr); // outpos | ||
return 0; | ||
} | ||
|
||
u32 sceAtracGetNextSample(int atracID, u32 outNAddr) | ||
|
@@ -503,7 +503,9 @@ u32 sceAtracGetSecondBufferInfo(int atracID, u32 outposAddr, u32 outBytesAddr) | |
Memory::Write_U32(0, outBytesAddr); | ||
return ATRAC_ERROR_SECOND_BUFFER_NOT_NEEDED; | ||
} | ||
//TODO | ||
u32 pos = (((atrac->loopEndSample >> (0x100B - atrac->codeType)) + 1) * atrac->atracBytesPerFrame + atrac->second.fileoffset - 1 ) + 1; | ||
Memory::Write_U32(pos, outposAddr); | ||
Memory::Write_U32(atrac->second.writableBytes - pos, outBytesAddr); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
unknownbrackets
Collaborator
|
||
return 0; | ||
} | ||
|
||
|
@@ -514,9 +516,14 @@ u32 sceAtracGetSoundSample(int atracID, u32 outEndSampleAddr, u32 outLoopStartSa | |
if (!atrac) { | ||
//return -1; | ||
} | ||
Memory::Write_U32(atrac->endSample, outEndSampleAddr); // outEndSample | ||
Memory::Write_U32(atrac->loopStartSample, outLoopStartSampleAddr); // outLoopStartSample | ||
Memory::Write_U32(atrac->loopEndSample, outLoopEndSampleAddr); // outLoopEndSample | ||
if (atrac->loopEndSample != 0) { | ||
Memory::Write_U32(atrac->endSample - atrac->currentSample, outEndSampleAddr); // outEndSample | ||
Memory::Write_U32(atrac->loopStartSample - atrac->currentSample, outLoopStartSampleAddr); // outLoopStartSample | ||
Memory::Write_U32(atrac->loopEndSample - atrac->currentSample, outLoopEndSampleAddr); // outLoopEndSample | ||
} else { | ||
Memory::Write_U32(-1, outLoopStartSampleAddr); | ||
Memory::Write_U32(-1, outLoopEndSampleAddr); | ||
} | ||
return 0; | ||
} | ||
|
||
|
These changes appear to have broken Valkyrie Profile (which already had major graphics issues.)
I think it is missing cases when
ATRAC_ERROR_SECOND_BUFFER_NOT_NEEDED
should be returned.-[Unknown]