sceUsbMic

This commit is contained in:
Florin9doi 2019-08-03 18:33:43 +03:00
parent 492df41b74
commit 99c4a00dae
8 changed files with 97 additions and 1 deletions

View File

@ -1647,6 +1647,8 @@ add_library(${CoreLibName} ${CoreLinkType}
Core/HLE/sceUsbCam.h
Core/HLE/sceUsbGps.cpp
Core/HLE/sceUsbGps.h
Core/HLE/sceUsbMic.cpp
Core/HLE/sceUsbMic.h
Core/HLE/sceUtility.cpp
Core/HLE/sceUtility.h
Core/HLE/sceVaudio.cpp

View File

@ -374,6 +374,7 @@
<ClCompile Include="HLE\KUBridge.cpp" />
<ClCompile Include="HLE\sceUsbAcc.cpp" />
<ClCompile Include="HLE\sceUsbCam.cpp" />
<ClCompile Include="HLE\sceUsbMic.cpp" />
<ClCompile Include="MIPS\IR\IRAsm.cpp" />
<ClCompile Include="MIPS\IR\IRCompALU.cpp" />
<ClCompile Include="MIPS\IR\IRCompBranch.cpp" />
@ -901,6 +902,7 @@
<ClInclude Include="HLE\KUBridge.h" />
<ClInclude Include="HLE\sceUsbAcc.h" />
<ClInclude Include="HLE\sceUsbCam.h" />
<ClInclude Include="HLE\sceUsbMic.h" />
<ClInclude Include="MIPS\IR\IRFrontend.h" />
<ClInclude Include="MIPS\IR\IRInst.h" />
<ClInclude Include="MIPS\IR\IRInterpreter.h" />

View File

@ -737,6 +737,9 @@
<ClCompile Include="Debugger\WebSocket\GPURecordSubscriber.cpp">
<Filter>Debugger\WebSocket</Filter>
</ClCompile>
<ClCompile Include="HLE\sceUsbMic.cpp">
<Filter>HLE\Libraries</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="ELF\ElfReader.h">
@ -1367,6 +1370,9 @@
<ClInclude Include="Debugger\WebSocket\GPURecordSubscriber.h">
<Filter>Debugger\WebSocket</Filter>
</ClInclude>
<ClInclude Include="HLE\sceUsbMic.h">
<Filter>HLE\Libraries</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="CMakeLists.txt" />

View File

@ -69,6 +69,7 @@
#include "sceUsbAcc.h"
#include "sceUsbCam.h"
#include "sceUsbGps.h"
#include "sceUsbMic.h"
#include "sceUtility.h"
#include "sceVaudio.h"
#include "sceMt19937.h"
@ -298,6 +299,7 @@ void RegisterAllModules() {
Register_sceNetIfhandle();
Register_KUBridge();
Register_sceUsbAcc();
Register_sceUsbMic();
// add new modules here.
}

View File

@ -50,6 +50,17 @@ static int sceUsbCamStopMic() {
return 0;
}
static int sceUsbCamReadMicBlocking(u32 bufAddr, u32 size) {
INFO_LOG(HLE, "UNIMPL sceUsbCamReadMicBlocking: size: %d", size);
for (unsigned int i = 0; i < size; i++) {
if (Memory::IsValidAddress(bufAddr + i)) {
Memory::Write_U8(i & 0xFF, bufAddr + i);
}
}
hleEatMicro(1000000 / micParam.frequency * (size / 2));
return size;
}
static int sceUsbCamSetupVideo(u32 paramAddr, u32 workareaAddr, int wasize) {
INFO_LOG(HLE, "UNIMPL sceUsbCamSetupVideo");
if (Memory::IsValidRange(paramAddr, sizeof(videoParam))) {
@ -115,7 +126,7 @@ const HLEFunction sceUsbCam[] =
{ 0X2E930264, nullptr, "sceUsbCamSetupMicEx", '?', "" },
{ 0X82A64030, &WrapI_V<sceUsbCamStartMic>, "sceUsbCamStartMic", 'i', "" },
{ 0X5145868A, &WrapI_V<sceUsbCamStopMic>, "sceUsbCamStopMic", 'i', "" },
{ 0X36636925, nullptr, "sceUsbCamReadMicBlocking", '?', "" },
{ 0X36636925, &WrapI_UU<sceUsbCamReadMicBlocking>, "sceUsbCamReadMicBlocking", 'i', "xx" },
{ 0X3DC0088E, nullptr, "sceUsbCamReadMic", '?', "" },
{ 0XB048A67D, nullptr, "sceUsbCamWaitReadMicEnd", '?', "" },
{ 0XF8847F60, nullptr, "sceUsbCamPollReadMicEnd", '?', "" },

52
Core/HLE/sceUsbMic.cpp Normal file
View File

@ -0,0 +1,52 @@
// Copyright (c) 2019- 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 <mutex>
#include "base/NativeApp.h"
#include "Common/ChunkFile.h"
#include "Core/HLE/HLE.h"
#include "Core/HLE/FunctionWrappers.h"
#include "Core/HLE/sceUsbMic.h"
#include "Core/MemMapHelpers.h"
static int sceUsbMicInputBlocking(u32 size, u32 samplerate, u32 bufAddr) {
INFO_LOG(HLE, "UNIMPL sceUsbMicInputBlocking: size: %d, samplerate: %d", size, samplerate);
for (unsigned int i = 0; i < size; i++) {
if (Memory::IsValidAddress(bufAddr + i)) {
Memory::Write_U8(i & 0xFF, bufAddr + i);
}
}
hleEatMicro(1000000 / samplerate * (size / 2));
return size;
}
const HLEFunction sceUsbMic[] =
{
{0x06128E42, nullptr, "sceUsbMicPollInputEnd", '?', "" },
{0x2E6DCDCD, &WrapI_UUU<sceUsbMicInputBlocking>, "sceUsbMicInputBlocking", 'i', "xxx" },
{0x45310F07, nullptr, "sceUsbMicInputInitEx", '?', "" },
{0x5F7F368D, nullptr, "sceUsbMicInput", '?', "" },
{0x63400E20, nullptr, "sceUsbMicGetInputLength", '?', "" },
{0xB8E536EB, nullptr, "sceUsbMicInputInit", '?', "" },
{0xF899001C, nullptr, "sceUsbMicWaitInputEnd", '?', "" },
};
void Register_sceUsbMic()
{
RegisterModule("sceUsbMic", ARRAY_SIZE(sceUsbMic), sceUsbMic);
}

20
Core/HLE/sceUsbMic.h Normal file
View File

@ -0,0 +1,20 @@
// Copyright (c) 2019- 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_sceUsbMic();

View File

@ -394,6 +394,7 @@ EXEC_AND_LIB_FILES := \
$(SRC)/Core/HLE/sceUsbAcc.cpp \
$(SRC)/Core/HLE/sceUsbCam.cpp \
$(SRC)/Core/HLE/sceUsbGps.cpp \
$(SRC)/Core/HLE/sceUsbMic.cpp \
$(SRC)/Core/HLE/sceUtility.cpp \
$(SRC)/Core/HLE/sceVaudio.cpp \
$(SRC)/Core/HLE/scePspNpDrm_user.cpp \