mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Update VS project files
This commit is contained in:
parent
b2b6b09072
commit
1a90e0c7ba
3 changed files with 124 additions and 116 deletions
|
@ -263,6 +263,7 @@
|
|||
<ClCompile Include="HW\MpegDemux.cpp" />
|
||||
<ClCompile Include="HW\SasAudio.cpp" />
|
||||
<ClCompile Include="HW\AsyncIOManager.cpp" />
|
||||
<ClCompile Include="HW\SimpleMp3Dec.cpp" />
|
||||
<ClCompile Include="Loaders.cpp" />
|
||||
<ClCompile Include="MemMap.cpp" />
|
||||
<ClCompile Include="MemmapFunctions.cpp" />
|
||||
|
@ -536,6 +537,7 @@
|
|||
<ClInclude Include="HW\SasAudio.h" />
|
||||
<ClInclude Include="HW\MemoryStick.h" />
|
||||
<ClInclude Include="HW\AsyncIOManager.h" />
|
||||
<ClInclude Include="HW\SimpleMp3Dec.h" />
|
||||
<ClInclude Include="Loaders.h" />
|
||||
<ClInclude Include="MemMap.h" />
|
||||
<ClInclude Include="MIPS\ARM\ArmAsm.h">
|
||||
|
|
|
@ -520,6 +520,9 @@
|
|||
<ClCompile Include="MIPS\PPC\PpcCompReplace.cpp">
|
||||
<Filter>MIPS\PPC</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="HW\SimpleMp3Dec.cpp">
|
||||
<Filter>HW</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="ELF\ElfReader.h">
|
||||
|
@ -960,6 +963,9 @@
|
|||
<ClInclude Include="HW\BufferQueue.h">
|
||||
<Filter>HW</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="HW\SimpleMp3Dec.h">
|
||||
<Filter>HW</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="CMakeLists.txt" />
|
||||
|
@ -967,4 +973,4 @@
|
|||
<None Include="..\android\jni\Android.mk" />
|
||||
<None Include="GameLogNotes.txt" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
</Project>
|
|
@ -1,120 +1,120 @@
|
|||
// Copyright (c) 2012- PPSSPP Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0 or later versions.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official git repository and contact information can be found at
|
||||
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
||||
|
||||
#include "Core/HLE/HLE.h"
|
||||
|
||||
#include "sceAudiocodec.h"
|
||||
#include "Core/Reporting.h"
|
||||
#include "Core/HW/SimpleMp3Dec.h"
|
||||
|
||||
enum {
|
||||
// Copyright (c) 2012- PPSSPP Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0 or later versions.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official git repository and contact information can be found at
|
||||
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
||||
|
||||
#include "Core/HLE/HLE.h"
|
||||
|
||||
#include "sceAudiocodec.h"
|
||||
#include "Core/Reporting.h"
|
||||
#include "Core/HW/SimpleMp3Dec.h"
|
||||
|
||||
enum {
|
||||
PSP_CODEC_AT3PLUS = 0x00001000,
|
||||
PSP_CODEC_AT3 = 0x00001001,
|
||||
PSP_CODEC_MP3 = 0x00001002,
|
||||
PSP_CODEC_AAC = 0x00001003,
|
||||
};
|
||||
|
||||
static const char *const codecNames[4] = {
|
||||
"AT3+", "AT3", "MP3", "AAC",
|
||||
};
|
||||
|
||||
static const char *GetCodecName(int codec) {
|
||||
if (codec >= PSP_CODEC_AT3PLUS && codec <= PSP_CODEC_AAC) {
|
||||
return codecNames[codec - PSP_CODEC_AT3PLUS];
|
||||
} else {
|
||||
return "(unk)";
|
||||
}
|
||||
}
|
||||
|
||||
// Following kaien_fr's sample code https://github.com/hrydgard/ppsspp/issues/5620#issuecomment-37086024
|
||||
// Should probably store the EDRAM get/release status somewhere within here, etc.
|
||||
struct AudioCodecContext {
|
||||
u32_le unknown[6];
|
||||
u32_le inDataPtr; // 6
|
||||
u32_le inDataSize; // 7
|
||||
u32_le outDataPtr; // 8
|
||||
u32_le audioSamplesPerFrame; // 9
|
||||
u32_le inDataSizeAgain; // 10 ??
|
||||
};
|
||||
|
||||
SimpleMP3* mp3;
|
||||
|
||||
int sceAudiocodecInit(u32 ctxPtr, int codec) {
|
||||
if (codec == PSP_CODEC_MP3){
|
||||
// Initialize MP3 audio decoder.
|
||||
mp3 = MP3Create();
|
||||
DEBUG_LOG(ME, "sceAudiocodecInit(%08x, %i (%s))", ctxPtr, codec, GetCodecName(codec));
|
||||
return 0;
|
||||
}
|
||||
ERROR_LOG_REPORT(ME, "UNIMPL sceAudiocodecInit(%08x, %i (%s))", ctxPtr, codec, GetCodecName(codec));
|
||||
return 0;
|
||||
}
|
||||
|
||||
int sceAudiocodecDecode(u32 ctxPtr, int codec) {
|
||||
if (!ctxPtr){
|
||||
ERROR_LOG_REPORT(ME, "sceAudiocodecDecode(%08x, %i (%s)) got NULL pointer", ctxPtr, codec, GetCodecName(codec));
|
||||
return -1;
|
||||
}
|
||||
if (codec == PSP_CODEC_MP3){
|
||||
//Use SimpleMp3Dec to decode Mp3 audio
|
||||
// Get AudioCodecContext
|
||||
AudioCodecContext* ctx = new AudioCodecContext;
|
||||
Memory::ReadStruct(ctxPtr, ctx);
|
||||
int outbytes = 0;
|
||||
// Decode Mp3 audio
|
||||
MP3Decode(mp3, Memory::GetPointer(ctx->inDataPtr), ctx->inDataSize, &outbytes, Memory::GetPointer(ctx->outDataPtr));
|
||||
DEBUG_LOG(ME, "sceAudiocodecDec(%08x, %i (%s))", ctxPtr, codec, GetCodecName(codec));
|
||||
return 0;
|
||||
}
|
||||
ERROR_LOG_REPORT(ME, "UNIMPL sceAudiocodecDecode(%08x, %i (%s))", ctxPtr, codec, GetCodecName(codec));
|
||||
return 0;
|
||||
}
|
||||
|
||||
int sceAudiocodecGetInfo(u32 ctxPtr, int codec) {
|
||||
ERROR_LOG_REPORT(ME, "UNIMPL sceAudiocodecGetInfo(%08x, %i (%s))", ctxPtr, codec, GetCodecName(codec));
|
||||
return 0;
|
||||
}
|
||||
|
||||
int sceAudiocodecCheckNeedMem(u32 ctxPtr, int codec) {
|
||||
WARN_LOG(ME, "UNIMPL sceAudiocodecCheckNeedMem(%08x, %i (%s))", ctxPtr, codec, GetCodecName(codec));
|
||||
return 0;
|
||||
}
|
||||
|
||||
int sceAudiocodecGetEDRAM(u32 ctxPtr, int codec) {
|
||||
WARN_LOG(ME, "UNIMPL sceAudiocodecGetEDRAM(%08x, %i (%s))", ctxPtr, codec, GetCodecName(codec));
|
||||
return 0;
|
||||
}
|
||||
|
||||
int sceAudiocodecReleaseEDRAM(u32 ctxPtr, int codec) {
|
||||
WARN_LOG(ME, "UNIMPL sceAudiocodecReleaseEDRAM(%08x, %i (%s))", ctxPtr, codec, GetCodecName(codec));
|
||||
return 0;
|
||||
}
|
||||
|
||||
const HLEFunction sceAudiocodec[] = {
|
||||
{0x70A703F8, WrapI_UI<sceAudiocodecDecode>, "sceAudiocodecDecode"},
|
||||
{0x5B37EB1D, WrapI_UI<sceAudiocodecInit>, "sceAudiocodecInit"},
|
||||
{0x8ACA11D5, WrapI_UI<sceAudiocodecGetInfo>, "sceAudiocodecGetInfo"},
|
||||
{0x3A20A200, WrapI_UI<sceAudiocodecGetEDRAM>, "sceAudiocodecGetEDRAM" },
|
||||
{0x29681260, WrapI_UI<sceAudiocodecReleaseEDRAM>, "sceAudiocodecReleaseEDRAM" },
|
||||
{0x9D3F790C, WrapI_UI<sceAudiocodecCheckNeedMem>, "sceAudiocodecCheckNeedMem" },
|
||||
{0x59176a0f, 0, "sceAudiocodec_59176A0F"},
|
||||
};
|
||||
|
||||
void Register_sceAudiocodec()
|
||||
{
|
||||
RegisterModule("sceAudiocodec", ARRAY_SIZE(sceAudiocodec), sceAudiocodec);
|
||||
};
|
||||
|
||||
static const char *const codecNames[4] = {
|
||||
"AT3+", "AT3", "MP3", "AAC",
|
||||
};
|
||||
|
||||
static const char *GetCodecName(int codec) {
|
||||
if (codec >= PSP_CODEC_AT3PLUS && codec <= PSP_CODEC_AAC) {
|
||||
return codecNames[codec - PSP_CODEC_AT3PLUS];
|
||||
} else {
|
||||
return "(unk)";
|
||||
}
|
||||
}
|
||||
|
||||
// Following kaien_fr's sample code https://github.com/hrydgard/ppsspp/issues/5620#issuecomment-37086024
|
||||
// Should probably store the EDRAM get/release status somewhere within here, etc.
|
||||
struct AudioCodecContext {
|
||||
u32_le unknown[6];
|
||||
u32_le inDataPtr; // 6
|
||||
u32_le inDataSize; // 7
|
||||
u32_le outDataPtr; // 8
|
||||
u32_le audioSamplesPerFrame; // 9
|
||||
u32_le inDataSizeAgain; // 10 ??
|
||||
};
|
||||
|
||||
SimpleMP3* mp3;
|
||||
|
||||
int sceAudiocodecInit(u32 ctxPtr, int codec) {
|
||||
if (codec == PSP_CODEC_MP3){
|
||||
// Initialize MP3 audio decoder.
|
||||
mp3 = MP3Create();
|
||||
DEBUG_LOG(ME, "sceAudiocodecInit(%08x, %i (%s))", ctxPtr, codec, GetCodecName(codec));
|
||||
return 0;
|
||||
}
|
||||
ERROR_LOG_REPORT(ME, "UNIMPL sceAudiocodecInit(%08x, %i (%s))", ctxPtr, codec, GetCodecName(codec));
|
||||
return 0;
|
||||
}
|
||||
|
||||
int sceAudiocodecDecode(u32 ctxPtr, int codec) {
|
||||
if (!ctxPtr){
|
||||
ERROR_LOG_REPORT(ME, "sceAudiocodecDecode(%08x, %i (%s)) got NULL pointer", ctxPtr, codec, GetCodecName(codec));
|
||||
return -1;
|
||||
}
|
||||
if (codec == PSP_CODEC_MP3){
|
||||
//Use SimpleMp3Dec to decode Mp3 audio
|
||||
// Get AudioCodecContext
|
||||
AudioCodecContext* ctx = new AudioCodecContext;
|
||||
Memory::ReadStruct(ctxPtr, ctx);
|
||||
int outbytes = 0;
|
||||
// Decode Mp3 audio
|
||||
MP3Decode(mp3, Memory::GetPointer(ctx->inDataPtr), ctx->inDataSize, &outbytes, Memory::GetPointer(ctx->outDataPtr));
|
||||
DEBUG_LOG(ME, "sceAudiocodecDec(%08x, %i (%s))", ctxPtr, codec, GetCodecName(codec));
|
||||
return 0;
|
||||
}
|
||||
ERROR_LOG_REPORT(ME, "UNIMPL sceAudiocodecDecode(%08x, %i (%s))", ctxPtr, codec, GetCodecName(codec));
|
||||
return 0;
|
||||
}
|
||||
|
||||
int sceAudiocodecGetInfo(u32 ctxPtr, int codec) {
|
||||
ERROR_LOG_REPORT(ME, "UNIMPL sceAudiocodecGetInfo(%08x, %i (%s))", ctxPtr, codec, GetCodecName(codec));
|
||||
return 0;
|
||||
}
|
||||
|
||||
int sceAudiocodecCheckNeedMem(u32 ctxPtr, int codec) {
|
||||
WARN_LOG(ME, "UNIMPL sceAudiocodecCheckNeedMem(%08x, %i (%s))", ctxPtr, codec, GetCodecName(codec));
|
||||
return 0;
|
||||
}
|
||||
|
||||
int sceAudiocodecGetEDRAM(u32 ctxPtr, int codec) {
|
||||
WARN_LOG(ME, "UNIMPL sceAudiocodecGetEDRAM(%08x, %i (%s))", ctxPtr, codec, GetCodecName(codec));
|
||||
return 0;
|
||||
}
|
||||
|
||||
int sceAudiocodecReleaseEDRAM(u32 ctxPtr, int codec) {
|
||||
WARN_LOG(ME, "UNIMPL sceAudiocodecReleaseEDRAM(%08x, %i (%s))", ctxPtr, codec, GetCodecName(codec));
|
||||
return 0;
|
||||
}
|
||||
|
||||
const HLEFunction sceAudiocodec[] = {
|
||||
{0x70A703F8, WrapI_UI<sceAudiocodecDecode>, "sceAudiocodecDecode"},
|
||||
{0x5B37EB1D, WrapI_UI<sceAudiocodecInit>, "sceAudiocodecInit"},
|
||||
{0x8ACA11D5, WrapI_UI<sceAudiocodecGetInfo>, "sceAudiocodecGetInfo"},
|
||||
{0x3A20A200, WrapI_UI<sceAudiocodecGetEDRAM>, "sceAudiocodecGetEDRAM" },
|
||||
{0x29681260, WrapI_UI<sceAudiocodecReleaseEDRAM>, "sceAudiocodecReleaseEDRAM" },
|
||||
{0x9D3F790C, WrapI_UI<sceAudiocodecCheckNeedMem>, "sceAudiocodecCheckNeedMem" },
|
||||
{0x59176a0f, 0, "sceAudiocodec_59176A0F"},
|
||||
};
|
||||
|
||||
void Register_sceAudiocodec()
|
||||
{
|
||||
RegisterModule("sceAudiocodec", ARRAY_SIZE(sceAudiocodec), sceAudiocodec);
|
||||
}
|
Loading…
Add table
Reference in a new issue