Skip to content

Commit

Permalink
Merge pull request #11305 from LunaMoo/sceUsbAcc
Browse files Browse the repository at this point in the history
Add sceUsbAcc stubs, improves EyePet(fixes endless loop on boot)
  • Loading branch information
hrydgard committed Aug 15, 2018
2 parents 6f173b9 + f038b64 commit ec5b0c2
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Expand Up @@ -1610,6 +1610,8 @@ add_library(${CoreLibName} ${CoreLinkType}
Core/HLE/sceUmd.h Core/HLE/sceUmd.h
Core/HLE/sceUsb.cpp Core/HLE/sceUsb.cpp
Core/HLE/sceUsb.h Core/HLE/sceUsb.h
Core/HLE/sceUsbAcc.cpp
Core/HLE/sceUsbAcc.h
Core/HLE/sceUsbCam.cpp Core/HLE/sceUsbCam.cpp
Core/HLE/sceUsbCam.h Core/HLE/sceUsbCam.h
Core/HLE/sceUsbGps.cpp Core/HLE/sceUsbGps.cpp
Expand Down
2 changes: 2 additions & 0 deletions Core/Core.vcxproj
Expand Up @@ -196,6 +196,7 @@
<ClCompile Include="Debugger\WebSocket\WebSocketUtils.cpp" /> <ClCompile Include="Debugger\WebSocket\WebSocketUtils.cpp" />
<ClCompile Include="FileSystems\BlobFileSystem.cpp" /> <ClCompile Include="FileSystems\BlobFileSystem.cpp" />
<ClCompile Include="HLE\KUBridge.cpp" /> <ClCompile Include="HLE\KUBridge.cpp" />
<ClCompile Include="HLE\sceUsbAcc.cpp" />
<ClCompile Include="HLE\sceUsbCam.cpp" /> <ClCompile Include="HLE\sceUsbCam.cpp" />
<ClCompile Include="MIPS\IR\IRAsm.cpp" /> <ClCompile Include="MIPS\IR\IRAsm.cpp" />
<ClCompile Include="MIPS\IR\IRCompALU.cpp" /> <ClCompile Include="MIPS\IR\IRCompALU.cpp" />
Expand Down Expand Up @@ -558,6 +559,7 @@
<ClInclude Include="FileSystems\BlobFileSystem.h" /> <ClInclude Include="FileSystems\BlobFileSystem.h" />
<ClInclude Include="HLE\KernelThreadDebugInterface.h" /> <ClInclude Include="HLE\KernelThreadDebugInterface.h" />
<ClInclude Include="HLE\KUBridge.h" /> <ClInclude Include="HLE\KUBridge.h" />
<ClInclude Include="HLE\sceUsbAcc.h" />
<ClInclude Include="HLE\sceUsbCam.h" /> <ClInclude Include="HLE\sceUsbCam.h" />
<ClInclude Include="MIPS\IR\IRFrontend.h" /> <ClInclude Include="MIPS\IR\IRFrontend.h" />
<ClInclude Include="MIPS\IR\IRInst.h" /> <ClInclude Include="MIPS\IR\IRInst.h" />
Expand Down
6 changes: 6 additions & 0 deletions Core/Core.vcxproj.filters
Expand Up @@ -731,6 +731,9 @@
<ClCompile Include="Debugger\WebSocket\GPUBufferSubscriber.cpp"> <ClCompile Include="Debugger\WebSocket\GPUBufferSubscriber.cpp">
<Filter>Debugger\WebSocket</Filter> <Filter>Debugger\WebSocket</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="HLE\sceUsbAcc.cpp">
<Filter>HLE\Libraries</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="ELF\ElfReader.h"> <ClInclude Include="ELF\ElfReader.h">
Expand Down Expand Up @@ -1355,6 +1358,9 @@
<ClInclude Include="ConfigValues.h"> <ClInclude Include="ConfigValues.h">
<Filter>Core</Filter> <Filter>Core</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="HLE\sceUsbAcc.h">
<Filter>HLE\Libraries</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="CMakeLists.txt" /> <None Include="CMakeLists.txt" />
Expand Down
2 changes: 2 additions & 0 deletions Core/HLE/HLETables.cpp
Expand Up @@ -66,6 +66,7 @@
#include "sceSsl.h" #include "sceSsl.h"
#include "sceUmd.h" #include "sceUmd.h"
#include "sceUsb.h" #include "sceUsb.h"
#include "sceUsbAcc.h"
#include "sceUsbCam.h" #include "sceUsbCam.h"
#include "sceUsbGps.h" #include "sceUsbGps.h"
#include "sceUtility.h" #include "sceUtility.h"
Expand Down Expand Up @@ -296,6 +297,7 @@ void RegisterAllModules() {
Register_sceNetUpnp(); Register_sceNetUpnp();
Register_sceNetIfhandle(); Register_sceNetIfhandle();
Register_KUBridge(); Register_KUBridge();
Register_sceUsbAcc();


// add new modules here. // add new modules here.
} }
Expand Down
46 changes: 46 additions & 0 deletions Core/HLE/sceUsbAcc.cpp
@@ -0,0 +1,46 @@
// 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/sceUsbAcc.h"

// Assuming https://github.com/joel16/usbacc/blob/master/usbacc.c is correct
// sceUsbAccGetAuthStat should return 0 or one of the two errors on failure
// sceUsbAccGetInfo should return 0 or one of the 3 errors on failure
// we don't have to deal with physical Usb connection, so let's just always pass

static int sceUsbAccGetAuthStat() {
INFO_LOG(HLE, "UNIMPL sceUsbAccGetAuthStat");
return 0;
}

static int sceUsbAccGetInfo(u32 addr) {
INFO_LOG(HLE, "UNIMPL sceUsbAccGetInfo");
return 0;
}

const HLEFunction sceUsbAcc[] =
{
{0X79A1C743, &WrapI_V<sceUsbAccGetAuthStat>, "sceUsbAccGetAuthStat", 'i', "" },
{0X0CD7D4AA, &WrapI_U<sceUsbAccGetInfo>, "sceUsbAccGetInfo", 'i', "x" },
};

void Register_sceUsbAcc()
{
RegisterModule("sceUsbAcc", ARRAY_SIZE(sceUsbAcc), sceUsbAcc);
}
21 changes: 21 additions & 0 deletions Core/HLE/sceUsbAcc.h
@@ -0,0 +1,21 @@
// 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_sceUsbAcc();

1 change: 1 addition & 0 deletions android/jni/Android.mk
Expand Up @@ -385,6 +385,7 @@ EXEC_AND_LIB_FILES := \
$(SRC)/Core/HLE/sceSsl.cpp \ $(SRC)/Core/HLE/sceSsl.cpp \
$(SRC)/Core/HLE/sceUmd.cpp \ $(SRC)/Core/HLE/sceUmd.cpp \
$(SRC)/Core/HLE/sceUsb.cpp \ $(SRC)/Core/HLE/sceUsb.cpp \
$(SRC)/Core/HLE/sceUsbAcc.cpp \
$(SRC)/Core/HLE/sceUsbCam.cpp \ $(SRC)/Core/HLE/sceUsbCam.cpp \
$(SRC)/Core/HLE/sceUsbGps.cpp \ $(SRC)/Core/HLE/sceUsbGps.cpp \
$(SRC)/Core/HLE/sceUtility.cpp \ $(SRC)/Core/HLE/sceUtility.cpp \
Expand Down

0 comments on commit ec5b0c2

Please sign in to comment.