diff --git a/CMakeLists.txt b/CMakeLists.txt index 51453db4fb..3d88f037b2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1172,6 +1172,8 @@ add_library(${CoreLibName} ${CoreLinkType} Core/HLE/sceAudio.cpp Core/HLE/sceAudiocodec.cpp Core/HLE/sceAudiocodec.h + Core/HLE/sceAudioRouting.cpp + Core/HLE/sceAudioRouting.h Core/HLE/sceAudio.h Core/HLE/sceCcc.h Core/HLE/sceCcc.cpp @@ -1185,6 +1187,8 @@ add_library(${CoreLibName} ${CoreLinkType} Core/HLE/sceDisplay.h Core/HLE/sceDmac.cpp Core/HLE/sceDmac.h + Core/HLE/sceG729.cpp + Core/HLE/sceG729.h Core/HLE/sceGameUpdate.cpp Core/HLE/sceGameUpdate.h Core/HLE/sceGe.cpp diff --git a/Core/CMakeLists.txt b/Core/CMakeLists.txt index ba804fbd51..351b28e320 100644 --- a/Core/CMakeLists.txt +++ b/Core/CMakeLists.txt @@ -32,6 +32,7 @@ set(SRCS HLE/sceAtrac.cpp HLE/__sceAudio.cpp HLE/sceAudio.cpp + HLE/sceAudioRouting.cpp HLE/sceCcc.cpp HLE/sceChnnlsv.cpp HLE/sceCtrl.cpp diff --git a/Core/Core.vcxproj b/Core/Core.vcxproj index a0720a7c62..d62edfb800 100644 --- a/Core/Core.vcxproj +++ b/Core/Core.vcxproj @@ -218,6 +218,7 @@ + @@ -225,6 +226,7 @@ + @@ -469,6 +471,7 @@ + @@ -476,6 +479,7 @@ + diff --git a/Core/Core.vcxproj.filters b/Core/Core.vcxproj.filters index 667148ba01..2aeb893964 100644 --- a/Core/Core.vcxproj.filters +++ b/Core/Core.vcxproj.filters @@ -177,6 +177,12 @@ HLE\Libraries + + HLE\Libraries + + + HLE\Libraries + HLE\Libraries @@ -189,6 +195,9 @@ HLE\Libraries + + HLE\Libraries + HLE\Libraries @@ -451,9 +460,6 @@ HW - - HLE\Libraries - Core @@ -664,6 +670,12 @@ HLE\Libraries + + HLE\Libraries + + + HLE\Libraries + HLE\Libraries @@ -706,6 +718,9 @@ HLE\Libraries + + HLE\Libraries + HLE\Libraries @@ -925,9 +940,6 @@ HW - - HLE\Libraries - Core diff --git a/Core/HLE/HLETables.cpp b/Core/HLE/HLETables.cpp index ba79f54853..878e58e8e6 100644 --- a/Core/HLE/HLETables.cpp +++ b/Core/HLE/HLETables.cpp @@ -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" @@ -72,6 +73,7 @@ #include "sceSha256.h" #include "sceAdler.h" #include "sceSfmt19937.h" +#include "sceG729.h" #define N(s) s @@ -336,5 +338,8 @@ void RegisterAllModules() { Register_sceSha256(); Register_sceAdler(); Register_sceSfmt19937(); + Register_sceAudioRouting(); + Register_sceUsbCam(); + Register_sceG729(); } diff --git a/Core/HLE/sceAudioRouting.cpp b/Core/HLE/sceAudioRouting.cpp new file mode 100644 index 0000000000..17f928aae5 --- /dev/null +++ b/Core/HLE/sceAudioRouting.cpp @@ -0,0 +1,65 @@ +// 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() { + INFO_LOG(HLE, "sceAudioRoutingGetMode"); + return 0; +} + +static int sceAudioRoutingSetVolumeMode(int mode) { + INFO_LOG(HLE, "sceAudioRoutingSetVolumeMode %d", mode); + int previousMode = audioRoutineVolumeMode; + audioRoutineVolumeMode = audioRoutingMode; + return previousMode; +} + +static int sceAudioRoutingGetVolumeMode() { + INFO_LOG(HLE, "sceAudioRoutingGetMode"); + return 0; +} + +static int sceAudioRoutingSetMode(int mode) { + INFO_LOG(HLE, "sceAudioRoutingSetMode %d", mode); + int previousMode = audioRoutingMode; + audioRoutingMode = mode; + return previousMode; +} + +const HLEFunction sceAudioRouting[] = +{ + {0x39240E7D, WrapI_V, "sceAudioRoutingGetMode" }, + {0x28235C56, WrapI_V, "sceAudioRoutingGetVolumeMode" }, + {0x36FD8AA9, WrapI_I, "sceAudioRoutingSetMode" }, + {0xBB548475, WrapI_I, "sceAudioRoutingSetVolumeMode" }, +}; + +void Register_sceAudioRouting() +{ + RegisterModule("sceAudioRouting", ARRAY_SIZE(sceAudioRouting), sceAudioRouting); +} diff --git a/Core/HLE/sceAudioRouting.h b/Core/HLE/sceAudioRouting.h new file mode 100644 index 0000000000..a66c4e56a8 --- /dev/null +++ b/Core/HLE/sceAudioRouting.h @@ -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(); diff --git a/Core/HLE/sceG729.cpp b/Core/HLE/sceG729.cpp new file mode 100644 index 0000000000..264bcc6efb --- /dev/null +++ b/Core/HLE/sceG729.cpp @@ -0,0 +1,40 @@ +// 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" + +const HLEFunction sceG729[] = +{ + { 0x13F1028A, 0, "sceG729DecodeExit" }, + { 0x17C11696, 0, "sceG729DecodeInitResource" }, + { 0x3489D1F3, 0, "sceG729DecodeCore" }, + { 0x55E14F75, 0, "sceG729DecodeInit" }, + { 0x5A409D1B, 0, "sceG729EncodeExit" }, + { 0x74804D93, 0, "sceG729DecodeReset" }, + { 0x890B86AE, 0, "sceG729DecodeTermResource" }, + { 0x8C87A2CA, 0, "sceG729EncodeReset" }, + { 0x94714D50, 0, "sceG729EncodeTermResource" }, + { 0xAA1E5462, 0, "sceG729EncodeInitResource" }, + { 0xCFCD367C, 0, "sceG729EncodeInit" }, + { 0xDB7259D5, 0, "sceG729EncodeCore" }, +}; + +void Register_sceG729() +{ + RegisterModule("sceG729", ARRAY_SIZE(sceG729), sceG729); +} diff --git a/Core/HLE/sceG729.h b/Core/HLE/sceG729.h new file mode 100644 index 0000000000..057c19c6db --- /dev/null +++ b/Core/HLE/sceG729.h @@ -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_sceG729(); diff --git a/Core/HLE/sceUsb.cpp b/Core/HLE/sceUsb.cpp index 424f44b0a0..27e5a561c0 100644 --- a/Core/HLE/sceUsb.cpp +++ b/Core/HLE/sceUsb.cpp @@ -122,9 +122,68 @@ const HLEFunction sceUsbstorBoot[] = {0xA55C9E16, 0, "sceUsbstorBootUnregisterNotify"}, }; +const HLEFunction sceUsbCam[] = +{ + { 0x17F7B2FB, 0, "sceUsbCamSetupVideo" }, + { 0xF93C4669, 0, "sceUsbCamAutoImageReverseSW" }, + { 0x574A8C3F, 0, "sceUsbCamStartVideo" }, + { 0x6CF32CB9, 0, "sceUsbCamStopVideo" }, + { 0x03ED7A82, 0, "sceUsbCamSetupMic" }, + { 0x82A64030, 0, "sceUsbCamStartMic" }, + { 0x7DAC0C71, 0, "sceUsbCamReadVideoFrameBlocking" }, + { 0x99D86281, 0, "sceUsbCamReadVideoFrame" }, + { 0x41E73E95, 0, "sceUsbCamPollReadVideoFrameEnd" }, + { 0xF90B2293, 0, "sceUsbCamWaitReadVideoFrameEnd" }, + { 0x4C34F553, 0, "sceUsbCamGetLensDirection" }, + { 0x3F0CF289, 0, "sceUsbCamSetupStill" }, + { 0x0A41A298, 0, "sceUsbCamSetupStillEx" }, + { 0x61BE5CAC, 0, "sceUsbCamStillInputBlocking" }, + { 0xFB0A6C5D, 0, "sceUsbCamStillInput" }, + { 0x7563AFA1, 0, "sceUsbCamStillWaitInputEnd" }, + { 0x1A46CFE7, 0, "sceUsbCamStillPollInputEnd" }, + { 0xA720937C, 0, "sceUsbCamStillCancelInput" }, + { 0xE5959C36, 0, "sceUsbCamStillGetInputLength" }, + { 0xCFE9E999, 0, "sceUsbCamSetupVideoEx" }, + { 0xDF9D0C92, 0, "sceUsbCamGetReadVideoFrameSize" }, + { 0x6E205974, 0, "sceUsbCamSetSaturation" }, + { 0x4F3D84D5, 0, "sceUsbCamSetBrightness" }, + { 0x09C26C7E, 0, "sceUsbCamSetContrast" }, + { 0x622F83CC, 0, "sceUsbCamSetSharpness" }, + { 0xD4876173, 0, "sceUsbCamSetImageEffectMode" }, + { 0x1D686870, 0, "sceUsbCamSetEvLevel" }, + { 0x951BEDF5, 0, "sceUsbCamSetReverseMode" }, + { 0xC484901F, 0, "sceUsbCamSetZoom" }, + { 0x383E9FA8, 0, "sceUsbCamGetSaturation" }, + { 0x70F522C5, 0, "sceUsbCamGetBrightness" }, + { 0xA063A957, 0, "sceUsbCamGetContrast" }, + { 0xFDB68C23, 0, "sceUsbCamGetSharpness" }, + { 0x994471E0, 0, "sceUsbCamGetImageEffectMode" }, + { 0x2BCD50C0, 0, "sceUsbCamGetEvLevel" }, + { 0xD5279339, 0, "sceUsbCamGetReverseMode" }, + { 0x9E8AAF8D, 0, "sceUsbCamGetZoom" }, + { 0x11A1F128, 0, "sceUsbCamGetAutoImageReverseState" }, + { 0x08AEE98A, 0, "sceUsbCamSetMicGain" }, + { 0x2E930264, 0, "sceUsbCamSetupMicEx" }, + { 0x36636925, 0, "sceUsbCamReadMicBlocking" }, + { 0x3DC0088E, 0, "sceUsbCamReadMic" }, + { 0x41EE8797, 0, "sceUsbCamUnregisterLensRotationCallback" }, + { 0x5145868A, 0, "sceUsbCamStopMic" }, + { 0x5778B452, 0, "sceUsbCamGetMicDataLength" }, + { 0x6784E6A8, 0, "sceUsbCamSetAntiFlicker" }, + { 0xAA7D94BA, 0, "sceUsbCamGetAntiFlicker" }, + { 0xB048A67D, 0, "sceUsbCamWaitReadMicEnd" }, + { 0xD293A100, 0, "sceUsbCamRegisterLensRotationCallback" }, + { 0xF8847F60, 0, "sceUsbCamPollReadMicEnd" }, +}; + void Register_sceUsb() { RegisterModule("sceUsbstor", ARRAY_SIZE(sceUsbstor), sceUsbstor); RegisterModule("sceUsbstorBoot", ARRAY_SIZE(sceUsbstorBoot), sceUsbstorBoot); RegisterModule("sceUsb", ARRAY_SIZE(sceUsb), sceUsb); } + +void Register_sceUsbCam() +{ + RegisterModule("sceUsbCam", ARRAY_SIZE(sceUsbCam), sceUsbCam); +} diff --git a/Core/HLE/sceUsb.h b/Core/HLE/sceUsb.h index d1b280be76..a50c049c68 100644 --- a/Core/HLE/sceUsb.h +++ b/Core/HLE/sceUsb.h @@ -21,3 +21,5 @@ void Register_sceUsb(); void __UsbInit(); void __UsbDoState(PointerWrap &p); + +void Register_sceUsbCam(); diff --git a/android/jni/Android.mk b/android/jni/Android.mk index d5b95304ff..de40bf89e7 100644 --- a/android/jni/Android.mk +++ b/android/jni/Android.mk @@ -226,12 +226,14 @@ 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 \ $(SRC)/Core/HLE/sceDeflt.cpp \ $(SRC)/Core/HLE/sceDisplay.cpp \ $(SRC)/Core/HLE/sceDmac.cpp \ + $(SRC)/Core/HLE/sceG729.cpp \ $(SRC)/Core/HLE/sceGe.cpp \ $(SRC)/Core/HLE/sceFont.cpp \ $(SRC)/Core/HLE/sceHeap.cpp \