From 1ff9507f7cb82115f8a5f2993e6ccb5b9f7e593c Mon Sep 17 00:00:00 2001 From: daniel229 Date: Wed, 13 Aug 2014 00:11:26 +0800 Subject: [PATCH 1/3] Add sceUsbGps module --- CMakeLists.txt | 2 ++ Core/CMakeLists.txt | 1 + Core/HLE/HLETables.cpp | 2 ++ Core/HLE/sceUsbGps.cpp | 46 ++++++++++++++++++++++++++++++++++++++++++ Core/HLE/sceUsbGps.h | 20 ++++++++++++++++++ android/jni/Android.mk | 1 + 6 files changed, 72 insertions(+) create mode 100644 Core/HLE/sceUsbGps.cpp create mode 100644 Core/HLE/sceUsbGps.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 87473cc08b..85e192aed1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1200,6 +1200,8 @@ add_library(${CoreLibName} ${CoreLinkType} Core/HLE/sceUmd.h Core/HLE/sceUsb.cpp Core/HLE/sceUsb.h + Core/HLE/sceUsbGps.cpp + Core/HLE/sceUsbGps.h Core/HLE/sceUtility.cpp Core/HLE/sceUtility.h Core/HLE/sceVaudio.cpp diff --git a/Core/CMakeLists.txt b/Core/CMakeLists.txt index e0b68caca9..9930c1f5ba 100644 --- a/Core/CMakeLists.txt +++ b/Core/CMakeLists.txt @@ -73,6 +73,7 @@ set(SRCS HLE/sceSas.cpp HLE/sceUmd.cpp HLE/sceUsb.cpp + HLE/sceUsbGps.cpp HLE/sceUtility.cpp HLE/sceParseUri.cpp HLE/sceSsl.cpp diff --git a/Core/HLE/HLETables.cpp b/Core/HLE/HLETables.cpp index e75f675b9b..bc5fabbc00 100644 --- a/Core/HLE/HLETables.cpp +++ b/Core/HLE/HLETables.cpp @@ -68,6 +68,7 @@ #include "sceUtility.h" #include "sceVaudio.h" #include "sceMt19937.h" +#include "sceUsbGps.h" #define N(s) s @@ -327,6 +328,7 @@ void RegisterAllModules() { Register_sceCtrl_driver(); Register_sceDisplay_driver(); Register_sceMpegbase(); + Register_sceUsbGps(); } diff --git a/Core/HLE/sceUsbGps.cpp b/Core/HLE/sceUsbGps.cpp new file mode 100644 index 0000000000..060a562b1a --- /dev/null +++ b/Core/HLE/sceUsbGps.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/sceUsbGps.h" + +enum UsbStatus { + GPS_STATE_OFF = 0, + GPS_STATE_ACTIVATING1 = 1, + GPS_STATE_ACTIVATING2 = 2, + GPS_STATE_ON = 3, +}; + +const HLEFunction sceUsbGps[] = +{ + {0x268F95CA, 0, "sceUsbGpsSetInitDataLocation"}, + {0x31F95CDE, 0, "sceUsbGpsGetPowerSaveMode"}, + {0x54D26AA4, 0, "sceUsbGpsGetInitDataLocation"}, + {0x63D1F89D, 0, "sceUsbGpsResetInitialPosition"}, + {0x69E4AAA8, 0, "sceUsbGpsSaveInitData"}, + {0x6EED4811, 0, "sceUsbGpsClose"}, + {0x7C16AC3A, 0, "sceUsbGpsGetState"}, + {0x934EC2B2, 0, "sceUsbGpsGetData"}, + {0x9D8F99E8, 0, "sceUsbGpsSetPowerSaveMode"}, + {0x9F267D34, 0, "sceUsbGpsOpen"}, + {0xA259CD67, 0, "sceUsbGpsReset"}, +}; + +void Register_sceUsbGps() +{ + RegisterModule("sceUsbGps", ARRAY_SIZE(sceUsbGps), sceUsbGps); +} diff --git a/Core/HLE/sceUsbGps.h b/Core/HLE/sceUsbGps.h new file mode 100644 index 0000000000..cb60f2eab4 --- /dev/null +++ b/Core/HLE/sceUsbGps.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_sceUsbGps(); diff --git a/android/jni/Android.mk b/android/jni/Android.mk index 0076471dd7..7a63066d4a 100644 --- a/android/jni/Android.mk +++ b/android/jni/Android.mk @@ -253,6 +253,7 @@ EXEC_AND_LIB_FILES := \ $(SRC)/Core/HLE/sceSsl.cpp \ $(SRC)/Core/HLE/sceUmd.cpp \ $(SRC)/Core/HLE/sceUsb.cpp \ + $(SRC)/Core/HLE/sceUsbGps.cpp \ $(SRC)/Core/HLE/sceUtility.cpp \ $(SRC)/Core/HLE/sceVaudio.cpp \ $(SRC)/Core/HLE/scePspNpDrm_user.cpp \ From 88124952a298cc2485665449ee758103aa67901d Mon Sep 17 00:00:00 2001 From: daniel229 Date: Wed, 13 Aug 2014 01:18:03 +0800 Subject: [PATCH 2/3] add sceUsbGpsOpen() function --- Core/HLE/sceUsbGps.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Core/HLE/sceUsbGps.cpp b/Core/HLE/sceUsbGps.cpp index 060a562b1a..6f47a4a3f2 100644 --- a/Core/HLE/sceUsbGps.cpp +++ b/Core/HLE/sceUsbGps.cpp @@ -16,6 +16,7 @@ // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. #include "Core/HLE/HLE.h" +#include "Core/HLE/FunctionWrappers.h" #include "Core/HLE/sceUsbGps.h" enum UsbStatus { @@ -25,6 +26,11 @@ enum UsbStatus { GPS_STATE_ON = 3, }; +int sceUsbGpsOpen() { + ERROR_LOG(HLE, "sceUsbGpsOpen"); + return 0; +} + const HLEFunction sceUsbGps[] = { {0x268F95CA, 0, "sceUsbGpsSetInitDataLocation"}, @@ -36,7 +42,7 @@ const HLEFunction sceUsbGps[] = {0x7C16AC3A, 0, "sceUsbGpsGetState"}, {0x934EC2B2, 0, "sceUsbGpsGetData"}, {0x9D8F99E8, 0, "sceUsbGpsSetPowerSaveMode"}, - {0x9F267D34, 0, "sceUsbGpsOpen"}, + {0x9F267D34, WrapI_V, "sceUsbGpsOpen" }, {0xA259CD67, 0, "sceUsbGpsReset"}, }; From a1f922baff209143fd43e20942868098352a1927 Mon Sep 17 00:00:00 2001 From: daniel229 Date: Wed, 13 Aug 2014 01:47:24 +0800 Subject: [PATCH 3/3] fix typo,add sceUsbGpsGetState() function --- Core/HLE/sceUsbGps.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Core/HLE/sceUsbGps.cpp b/Core/HLE/sceUsbGps.cpp index 6f47a4a3f2..9244a0d66f 100644 --- a/Core/HLE/sceUsbGps.cpp +++ b/Core/HLE/sceUsbGps.cpp @@ -26,8 +26,13 @@ enum UsbStatus { GPS_STATE_ON = 3, }; +int sceUsbGpsGetState(u32 stateAddr) { + ERROR_LOG(HLE, "UNIMPL sceUsbGpsGetData(%08x)", stateAddr); + return 0; +} + int sceUsbGpsOpen() { - ERROR_LOG(HLE, "sceUsbGpsOpen"); + ERROR_LOG(HLE, "UNIMPL sceUsbGpsOpen"); return 0; } @@ -39,10 +44,10 @@ const HLEFunction sceUsbGps[] = {0x63D1F89D, 0, "sceUsbGpsResetInitialPosition"}, {0x69E4AAA8, 0, "sceUsbGpsSaveInitData"}, {0x6EED4811, 0, "sceUsbGpsClose"}, - {0x7C16AC3A, 0, "sceUsbGpsGetState"}, + {0x7C16AC3A, WrapI_U, "sceUsbGpsGetState"}, {0x934EC2B2, 0, "sceUsbGpsGetData"}, {0x9D8F99E8, 0, "sceUsbGpsSetPowerSaveMode"}, - {0x9F267D34, WrapI_V, "sceUsbGpsOpen" }, + {0x9F267D34, WrapI_V, "sceUsbGpsOpen"}, {0xA259CD67, 0, "sceUsbGpsReset"}, };