From f038b6489a14c883377e1fccdd6f0a44a70749e6 Mon Sep 17 00:00:00 2001 From: LunaMoo Date: Wed, 15 Aug 2018 18:35:07 +0200 Subject: [PATCH] Add sceUsbAcc stubs, improves EyePet(fixes endless loop on boot) --- CMakeLists.txt | 2 ++ Core/Core.vcxproj | 2 ++ Core/Core.vcxproj.filters | 6 +++++ Core/HLE/HLETables.cpp | 2 ++ Core/HLE/sceUsbAcc.cpp | 46 +++++++++++++++++++++++++++++++++++++++ Core/HLE/sceUsbAcc.h | 21 ++++++++++++++++++ android/jni/Android.mk | 1 + 7 files changed, 80 insertions(+) create mode 100644 Core/HLE/sceUsbAcc.cpp create mode 100644 Core/HLE/sceUsbAcc.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 2e34d5fe76ff..010b77f441c1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1610,6 +1610,8 @@ add_library(${CoreLibName} ${CoreLinkType} Core/HLE/sceUmd.h Core/HLE/sceUsb.cpp Core/HLE/sceUsb.h + Core/HLE/sceUsbAcc.cpp + Core/HLE/sceUsbAcc.h Core/HLE/sceUsbCam.cpp Core/HLE/sceUsbCam.h Core/HLE/sceUsbGps.cpp diff --git a/Core/Core.vcxproj b/Core/Core.vcxproj index f85082b0d246..068241f0c6cb 100644 --- a/Core/Core.vcxproj +++ b/Core/Core.vcxproj @@ -196,6 +196,7 @@ + @@ -558,6 +559,7 @@ + diff --git a/Core/Core.vcxproj.filters b/Core/Core.vcxproj.filters index b398758157e5..ba79121304fd 100644 --- a/Core/Core.vcxproj.filters +++ b/Core/Core.vcxproj.filters @@ -731,6 +731,9 @@ Debugger\WebSocket + + HLE\Libraries + @@ -1355,6 +1358,9 @@ Core + + HLE\Libraries + diff --git a/Core/HLE/HLETables.cpp b/Core/HLE/HLETables.cpp index 129fc6935411..ed1331f3ada9 100644 --- a/Core/HLE/HLETables.cpp +++ b/Core/HLE/HLETables.cpp @@ -66,6 +66,7 @@ #include "sceSsl.h" #include "sceUmd.h" #include "sceUsb.h" +#include "sceUsbAcc.h" #include "sceUsbCam.h" #include "sceUsbGps.h" #include "sceUtility.h" @@ -296,6 +297,7 @@ void RegisterAllModules() { Register_sceNetUpnp(); Register_sceNetIfhandle(); Register_KUBridge(); + Register_sceUsbAcc(); // add new modules here. } diff --git a/Core/HLE/sceUsbAcc.cpp b/Core/HLE/sceUsbAcc.cpp new file mode 100644 index 000000000000..93d6add3cb4f --- /dev/null +++ b/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", 'i', "" }, + {0X0CD7D4AA, &WrapI_U, "sceUsbAccGetInfo", 'i', "x" }, +}; + +void Register_sceUsbAcc() +{ + RegisterModule("sceUsbAcc", ARRAY_SIZE(sceUsbAcc), sceUsbAcc); +} diff --git a/Core/HLE/sceUsbAcc.h b/Core/HLE/sceUsbAcc.h new file mode 100644 index 000000000000..da84904d1faa --- /dev/null +++ b/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(); + diff --git a/android/jni/Android.mk b/android/jni/Android.mk index b6a7c18f5344..171ca313101f 100644 --- a/android/jni/Android.mk +++ b/android/jni/Android.mk @@ -385,6 +385,7 @@ EXEC_AND_LIB_FILES := \ $(SRC)/Core/HLE/sceSsl.cpp \ $(SRC)/Core/HLE/sceUmd.cpp \ $(SRC)/Core/HLE/sceUsb.cpp \ + $(SRC)/Core/HLE/sceUsbAcc.cpp \ $(SRC)/Core/HLE/sceUsbCam.cpp \ $(SRC)/Core/HLE/sceUsbGps.cpp \ $(SRC)/Core/HLE/sceUtility.cpp \