Add sceAudioRouting

First step to fix "Invizimals" 's game
This commit is contained in:
sum2012 2015-03-08 10:58:12 +08:00
parent 077eae6255
commit 7b262949aa
6 changed files with 88 additions and 6 deletions

View File

@ -218,6 +218,7 @@
<ClCompile Include="HLE\sceAtrac.cpp" />
<ClCompile Include="HLE\sceAudio.cpp" />
<ClCompile Include="HLE\sceAudiocodec.cpp" />
<ClCompile Include="HLE\sceAudioRouting.cpp" />
<ClCompile Include="HLE\sceCcc.cpp" />
<ClCompile Include="HLE\sceChnnlsv.cpp" />
<ClCompile Include="HLE\sceCtrl.cpp" />
@ -469,6 +470,7 @@
<ClInclude Include="HLE\sceAtrac.h" />
<ClInclude Include="HLE\sceAudio.h" />
<ClInclude Include="HLE\sceAudiocodec.h" />
<ClInclude Include="HLE\sceAudioRouting.h" />
<ClInclude Include="HLE\sceCcc.h" />
<ClInclude Include="HLE\sceCtrl.h" />
<ClInclude Include="HLE\sceChnnlsv.h" />

View File

@ -177,6 +177,12 @@
<ClCompile Include="HLE\sceAudio.cpp">
<Filter>HLE\Libraries</Filter>
</ClCompile>
<ClCompile Include="HLE\sceAudiocodec.cpp">
<Filter>HLE\Libraries</Filter>
</ClCompile>
<ClCompile Include="HLE\sceAudioRouting.cpp">
<Filter>HLE\Libraries</Filter>
</ClCompile>
<ClCompile Include="HLE\sceCcc.cpp">
<Filter>HLE\Libraries</Filter>
</ClCompile>
@ -451,9 +457,6 @@
<ClCompile Include="HW\MpegDemux.cpp">
<Filter>HW</Filter>
</ClCompile>
<ClCompile Include="HLE\sceAudiocodec.cpp">
<Filter>HLE\Libraries</Filter>
</ClCompile>
<ClCompile Include="HDRemaster.cpp">
<Filter>Core</Filter>
</ClCompile>
@ -664,6 +667,12 @@
<ClInclude Include="HLE\sceAudio.h">
<Filter>HLE\Libraries</Filter>
</ClInclude>
<ClInclude Include="HLE\sceAudiocodec.h">
<Filter>HLE\Libraries</Filter>
</ClInclude>
<ClInclude Include="HLE\sceAudioRouting.h">
<Filter>HLE\Libraries</Filter>
</ClInclude>
<ClInclude Include="HLE\sceCcc.h">
<Filter>HLE\Libraries</Filter>
</ClInclude>
@ -925,9 +934,6 @@
<ClInclude Include="HW\MpegDemux.h">
<Filter>HW</Filter>
</ClInclude>
<ClInclude Include="HLE\sceAudiocodec.h">
<Filter>HLE\Libraries</Filter>
</ClInclude>
<ClInclude Include="HDRemaster.h">
<Filter>Core</Filter>
</ClInclude>

View File

@ -22,6 +22,7 @@
#include "sceAtrac.h"
#include "sceAudio.h"
#include "sceAudiocodec.h"
#include "sceAudioRouting.h"
#include "sceCcc.h"
#include "sceChnnlsv.h"
#include "sceCtrl.h"
@ -336,5 +337,6 @@ void RegisterAllModules() {
Register_sceSha256();
Register_sceAdler();
Register_sceSfmt19937();
Register_sceAudioRouting();
}

View File

@ -0,0 +1,51 @@
// 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 "Core/HLE/FunctionWrappers.h"
#include "Core/HLE/sceAudiocodec.h"
enum {
AUDIO_ROUTING_SPEAKER_OFF = 0,
AUDIO_ROUTING_SPEAKER_ON = 1,
};
u32 audioRoutingMode = AUDIO_ROUTING_SPEAKER_ON;
u32 audioRoutineVolumeMode = AUDIO_ROUTING_SPEAKER_ON;
static int sceAudioRoutingGetMode() {
DEBUG_LOG(HLE, "sceAudioRoutingGetMode");
return 0;
}
static int sceAudioRoutingSetVolumeMode(int mode) {
DEBUG_LOG(HLE, "sceAudioRoutingSetVolumeMode");
int previousMode = audioRoutineVolumeMode;
audioRoutineVolumeMode = mode;
return previousMode;
}
const HLEFunction sceAudioRouting[] =
{
{0x39240E7D, WrapI_V<sceAudioRoutingGetMode>, "sceAudioRoutingGetMode" },
{0x28235C56, WrapI_I<sceAudioRoutingSetVolumeMode>, "sceAudioRoutingSetVolumeMode" },
};
void Register_sceAudioRouting()
{
RegisterModule("sceAudioRouting", ARRAY_SIZE(sceAudioRouting), sceAudioRouting);
}

View File

@ -0,0 +1,20 @@
// 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/.
#pragma once
void Register_sceAudioRouting();

View File

@ -226,6 +226,7 @@ EXEC_AND_LIB_FILES := \
$(SRC)/Core/HLE/__sceAudio.cpp.arm \
$(SRC)/Core/HLE/sceAudio.cpp.arm \
$(SRC)/Core/HLE/sceAudiocodec.cpp.arm \
$(SRC)/Core/HLE/sceAudioRouting.cpp \
$(SRC)/Core/HLE/sceChnnlsv.cpp \
$(SRC)/Core/HLE/sceCcc.cpp \
$(SRC)/Core/HLE/sceCtrl.cpp.arm \