Add the correct spelling of sceAtracGetBufferInfoForResetting. Add a psmf function.

This commit is contained in:
Henrik Rydgard 2013-01-05 18:10:13 +01:00
parent cf8fb7137d
commit 4c8584da71
2 changed files with 53 additions and 15 deletions

View File

@ -29,10 +29,36 @@
#define ATRAC_ERROR_ALL_DATA_DECODED 0x80630024
struct Atrac {
};
Atrac globalAtrac;
// TODO: Properly.
Atrac *getAtrac(int atracID) {
if (atracID == 1) {
return &globalAtrac;
} else {
return 0;
}
}
u32 sceAtracGetAtracID(int codecType)
{
ERROR_LOG(HLE, "FAKE sceAtracGetAtracID(%i)", codecType);
return 1;
}
u32 sceAtracAddStreamData(int atracID, u32 bytesToAdd)
{
ERROR_LOG(HLE, "UNIMPL sceAtracAddStreamData(%i, %08x)", atracID, bytesToAdd);
Atrac *atrac = getAtrac(atracID);
if (!atrac) {
return -1;
}
// TODO
return 0;
}
@ -56,15 +82,11 @@ u32 sceAtracEndEntry()
return 0;
}
u32 sceAtracGetAtracID(int codecType)
{
ERROR_LOG(HLE, "UNIMPL sceAtracGetAtracID(%i)", codecType);
return 1;
}
u32 sceAtracGetBufferInfoForReseting(int atracID, int sample, u32 bufferInfoAddr)
{
ERROR_LOG(HLE, "UNIMPL sceAtracGetBufferInfoForReseting(%i, %i, %08x)",atracID, sample, bufferInfoAddr);
// TODO: Write the right stuff instead.
Memory::Memset(bufferInfoAddr, 0, 32);
return 0;
}
@ -254,7 +276,7 @@ const HLEFunction sceAtrac3plus[] =
{0x132f1eca,WrapI_V<sceAtracReinit>,"sceAtracReinit"},
{0xeca32a99,WrapI_I<sceAtracIsSecondBufferNeeded>,"sceAtracIsSecondBufferNeeded"},
{0x0fae370e,WrapI_IUUU<sceAtracSetHalfwayBufferAndGetID>,"sceAtracSetHalfwayBufferAndGetID"},
{0x2DD3E298,0,"sceAtracGetBufferInfoForResetting"},
{0x2DD3E298,WrapU_IIU<sceAtracGetBufferInfoForReseting>,"sceAtracGetBufferInfoForResetting"},
{0x5CF9D852,0,"sceAtracSetMOutHalfwayBuffer"},
{0xB3B5D042,WrapI_IU<sceAtracGetOutputChannel>,"sceAtracGetOutputChannel"},
{0xF6837A1A,0,"sceAtracSetMOutData"},

View File

@ -57,6 +57,7 @@ class PsmfStream;
// TODO: Change to work directly with the data in RAM instead of this
// JPSCP-esque class.
typedef std::map<int, PsmfStream *> PsmfStreamMap;
class Psmf {
public:
Psmf(u32 data);
@ -324,8 +325,7 @@ u32 scePsmfSpecifyStreamWithStreamTypeNumber(u32 psmfStruct, u32 streamType, u32
return 0;
}
u32 scePsmfGetVideoInfo(u32 psmfStruct, u32 videoInfoAddr)
{
u32 scePsmfGetVideoInfo(u32 psmfStruct, u32 videoInfoAddr) {
INFO_LOG(HLE, "scePsmfGetVideoInfo(%08x, %08x)", psmfStruct, videoInfoAddr);
Psmf *psmf = getPsmf(psmfStruct);
if (!psmf) {
@ -339,8 +339,7 @@ u32 scePsmfGetVideoInfo(u32 psmfStruct, u32 videoInfoAddr)
return 0;
}
u32 scePsmfGetAudioInfo(u32 psmfStruct, u32 audioInfoAddr)
{
u32 scePsmfGetAudioInfo(u32 psmfStruct, u32 audioInfoAddr) {
INFO_LOG(HLE, "scePsmfGetAudioInfo(%08x, %08x)", psmfStruct, audioInfoAddr);
Psmf *psmf = getPsmf(psmfStruct);
if (!psmf) {
@ -354,11 +353,28 @@ u32 scePsmfGetAudioInfo(u32 psmfStruct, u32 audioInfoAddr)
return 0;
}
u32 scePsmfGetCurrentStreamType(u32 psmfStruct, u32 typeAddr, u32 channelAddr) {
INFO_LOG(HLE, "scePsmfGetCurrentStreamType(%08x, %08x, %08x)", psmfStruct, typeAddr, channelAddr);
Psmf *psmf = getPsmf(psmfStruct);
if (!psmf) {
ERROR_LOG(HLE, "scePsmfGetCurrentStreamType - invalid psmf");
return ERROR_PSMF_NOT_FOUND;
}
if (Memory::IsValidAddress(typeAddr)) {
u32 type = 0, channel = 0;
if (psmf->streamMap.find(psmf->currentStreamNum) != psmf->streamMap.end())
type = psmf->streamMap[psmf->currentStreamNum]->type;
if (psmf->streamMap.find(psmf->currentStreamNum) != psmf->streamMap.end())
channel = psmf->streamMap[psmf->currentStreamNum]->channel;
Memory::Write_U32(type, typeAddr);
Memory::Write_U32(channel, channelAddr);
}
return 0;
}
const HLEFunction scePsmf[] =
{
{0xc22c8327,&WrapU_UU<scePsmfSetPsmf>,"scePsmfSetPsmfFunction"},
{0xC7DB3A5B,0,"scePsmfGetCurrentStreamTypeFunction"},
const HLEFunction scePsmf[] = {
{0xc22c8327,WrapU_UU<scePsmfSetPsmf>,"scePsmfSetPsmfFunction"},
{0xC7DB3A5B,WrapU_UUU<scePsmfGetCurrentStreamType>,"scePsmfGetCurrentStreamTypeFunction"},
{0x28240568,0,"scePsmfGetCurrentStreamNumberFunction"},
{0x1E6D9013,&WrapU_UUU<scePsmfSpecifyStreamWithStreamType>,"scePsmfSpecifyStreamWithStreamTypeFunction"},
{0x0C120E1D,&WrapU_UUU<scePsmfSpecifyStreamWithStreamTypeNumber>,"scePsmfSpecifyStreamWithStreamTypeNumberFunction"},