diff --git a/CMakeLists.txt b/CMakeLists.txt index a77daad447f2..901b1f87ebd5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -808,6 +808,10 @@ add_library(${CoreLibName} ${CoreLinkType} Core/HLE/sceVaudio.h Core/HLE/scePspNpDrm_user.cpp Core/HLE/scePspNpDrm_user.h + Core/HLE/sceNp.cpp + Core/HLE/sceNp.h + Core/HLE/scePauth.cpp + Core/HLE/scePauth.h Core/HW/MediaEngine.cpp Core/HW/MediaEngine.h Core/HW/MemoryStick.cpp diff --git a/Core/Core.vcxproj b/Core/Core.vcxproj index 752b5962605b..879a5388bf49 100644 --- a/Core/Core.vcxproj +++ b/Core/Core.vcxproj @@ -201,9 +201,11 @@ + + @@ -371,9 +373,11 @@ + + diff --git a/Core/Core.vcxproj.filters b/Core/Core.vcxproj.filters index 38cfd464f10d..05a06e0530f0 100644 --- a/Core/Core.vcxproj.filters +++ b/Core/Core.vcxproj.filters @@ -401,6 +401,12 @@ ELF + + HLE\Libraries + + + HLE\Libraries + @@ -740,6 +746,12 @@ ELF + + HLE\Libraries + + + HLE\Libraries + @@ -747,4 +759,4 @@ - + \ No newline at end of file diff --git a/Core/HLE/HLETables.cpp b/Core/HLE/HLETables.cpp index 7ffd39c741bc..987b49c98f34 100644 --- a/Core/HLE/HLETables.cpp +++ b/Core/HLE/HLETables.cpp @@ -59,6 +59,8 @@ #include "sceGameUpdate.h" #include "sceDeflt.h" #include "sceMp4.h" +#include "scePauth.h" +#include "sceNp.h" #define N(s) s @@ -256,6 +258,11 @@ void RegisterAllModules() { Register_sceGameUpdate(); Register_sceDeflt(); Register_sceMp4(); + Register_scePauth(); + Register_sceNp(); + Register_sceNpCommerce2(); + Register_sceNpService(); + Regester_sceNpAuth(); for (int i = 0; i < numModules; i++) { diff --git a/Core/HLE/sceHttp.cpp b/Core/HLE/sceHttp.cpp index 2d57a9d555c3..6ee5de7ab6f6 100644 --- a/Core/HLE/sceHttp.cpp +++ b/Core/HLE/sceHttp.cpp @@ -19,6 +19,11 @@ #include "sceHttp.h" +int sceHttpSetResolveRetry(int connectionID, int retryCount) +{ + ERROR_LOG(HLE, "UNIMPL sceHttpSetResolveRetry()"); + return 0; +} /* * 0x62411801 sceSircsInit @@ -55,6 +60,7 @@ const HLEFunction sceHttp[] = { {0xc10b6bd9,0,"sceHttpAbortRequest"}, {0xfcf8c055,0,"sceHttpDeleteTemplate"}, {0xf49934f6,0,"sceHttpSetMallocFunction"}, + {0x03D9526F,&WrapI_II, "sceHttpSetResolveRetry"}, {0x47940436,0,"sceHttpSetResolveTimeOut"}, {0x2a6c3296,0,"sceHttpSetAuthInfoCB"}, {0xd081ec8f,0,"sceHttpGetNetworkErrno"}, diff --git a/Core/HLE/sceHttp.h b/Core/HLE/sceHttp.h index 30dc9db448f5..e18f02e36ca9 100644 --- a/Core/HLE/sceHttp.h +++ b/Core/HLE/sceHttp.h @@ -17,4 +17,6 @@ #pragma once +int sceHttpSetResolveRetry(int connectionID, int retryCount); + void Register_sceHttp(); \ No newline at end of file diff --git a/Core/HLE/sceKernel.cpp b/Core/HLE/sceKernel.cpp index 09cb7215473f..4cc35e190f6f 100644 --- a/Core/HLE/sceKernel.cpp +++ b/Core/HLE/sceKernel.cpp @@ -234,13 +234,18 @@ void sceKernelExitGameWithStatus() Core_Stop(); } +int LoadExecForUser_362A956B() +{ + ERROR_LOG(HLE,"UNIMPL LoadExecForUser_362A956B()"); + return 0; +} + u32 sceKernelRegisterExitCallback(u32 cbId) { DEBUG_LOG(HLE,"NOP sceKernelRegisterExitCallback(%i)", cbId); return 0; } - u32 sceKernelDevkitVersion() { int firmwareVersion = 150; @@ -611,7 +616,7 @@ u32 sceKernelReferThreadProfiler(u32 statusPtr) { } int sceKernelReferGlobalProfiler(u32 statusPtr) { - DEBUG_LOG(HLE, "UNIMPL sceKernelReferGlobalProfiler(%08x)", statusPtr); + ERROR_LOG(HLE, "UNIMPL sceKernelReferGlobalProfiler(%08x)", statusPtr); // Ignore for now return 0; } @@ -812,6 +817,7 @@ const HLEFunction LoadExecForUser[] = {0x4AC57943,&WrapU_U,"sceKernelRegisterExitCallback"}, {0xBD2F1094,&WrapI_CU,"sceKernelLoadExec"}, {0x2AC9954B,&WrapV_V,"sceKernelExitGameWithStatus"}, + {0x362A956B,&WrapI_V, "LoadExecForUser_362A956B"}, }; void Register_LoadExecForUser() diff --git a/Core/HLE/sceKernel.h b/Core/HLE/sceKernel.h index 6716f2806419..dfb2f5060c80 100644 --- a/Core/HLE/sceKernel.h +++ b/Core/HLE/sceKernel.h @@ -287,8 +287,10 @@ bool __KernelLoadExec(const char *filename, SceKernelLoadExecParam *param); int sceKernelLoadExec(const char *filename, u32 paramPtr); -void sceKernelRegisterExitCallback(); void sceKernelExitGame(); +void sceKernelExitGameWithStatus(); +int LoadExecForUser_362A956B(); +void sceKernelRegisterExitCallback(); void sceKernelSleepThread(); void sceKernelSleepThreadCB(); diff --git a/Core/HLE/sceNp.cpp b/Core/HLE/sceNp.cpp new file mode 100644 index 000000000000..edcdf4ef6509 --- /dev/null +++ b/Core/HLE/sceNp.cpp @@ -0,0 +1,91 @@ +// 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/. + +// This is pretty much a stub implementation. Doesn't actually do anything, just tries to return values +// to keep games happy anyway. So, no ATRAC3 music until someone has reverse engineered Atrac3+. + +#include "HLE.h" + +#include "sceNp.h" + +int sceNp_857B47D3() +{ + // No parameters + ERROR_LOG(HLE, "UNIMPL sceNp_857B47D3()"); + return 0; +} + +int sceNp_37E1E274() +{ + // No parameters + ERROR_LOG(HLE, "UNIMPL sceNp_37E1E274()"); + return 0; +} + +const HLEFunction sceNp[] = { + {0x857B47D3, &WrapI_V, "sceNp_857B47D3"}, + {0x37E1E274, &WrapI_V, "sceNp_37E1E274"}, +}; + +void Register_sceNp() +{ + RegisterModule("sceNp", ARRAY_SIZE(sceNp), sceNp); +} + +const HLEFunction sceNpAuth[] = { + {0x4EC1F667, 0, "sceNpAuth_4EC1F667"}, + {0xA1DE86F8, 0, "sceNpAuth_A1DE86F8"}, +}; + +void Regester_sceNpAuth() +{ + RegisterModule("sceNpAuth", ARRAY_SIZE(sceNpAuth), sceNpAuth); +} + +const HLEFunction sceNpService[] = { + {0x00ACFAC3, 0, "sceNpService_00ACFAC3"}, + {0x0F8F5821, 0, "sceNpService_0F8F5821"}, +}; + +void Register_sceNpService() +{ + RegisterModule("sceNpService", ARRAY_SIZE(sceNpService), sceNpService); +} + +const HLEFunction sceNpCommerce2[] = { + {0x005B5F20, 0, "sceNpCommerce2_005B5F20"}, + {0x0e9956e3, 0, "sceNpCommerce2_0e9956e3"}, + {0x1888a9fe, 0, "sceNpCommerce2_1888a9fe"}, + {0x1c952dcb, 0, "sceNpCommerce2_1c952dcb"}, + {0x2b25f6e9, 0, "sceNpCommerce2_2b25f6e9"}, + {0x3371d5f1, 0, "sceNpCommerce2_3371d5f1"}, + {0x4ecd4503, 0, "sceNpCommerce2_4ecd4503"}, + {0x590a3229, 0, "sceNpCommerce2_590a3229"}, + {0x6f1fe37f, 0, "sceNpCommerce2_6f1fe37f"}, + {0xa5a34ea4, 0, "sceNpCommerce2_a5a34ea4"}, + {0xaa4a1e3d, 0, "sceNpCommerce2_aa4a1e3d"}, + {0xbc61ffc8, 0, "sceNpCommerce2_bc61ffc8"}, + {0xc7f32242, 0, "sceNpCommerce2_c7f32242"}, + {0xf2278b90, 0, "sceNpCommerce2_f2278b90"}, + {0xf297ab9c, 0, "sceNpCommerce2_f297ab9c"}, + {0xfc30c19e, 0, "sceNpCommerce2_fc30c19e"}, +}; + +void Register_sceNpCommerce2() +{ + RegisterModule("sceNpCommerce2", ARRAY_SIZE(sceNpCommerce2), sceNpCommerce2); +} \ No newline at end of file diff --git a/Core/HLE/sceNp.h b/Core/HLE/sceNp.h new file mode 100644 index 000000000000..f2cc458e87c7 --- /dev/null +++ b/Core/HLE/sceNp.h @@ -0,0 +1,23 @@ +// 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_sceNp(); +void Register_sceNpCommerce2(); +void Register_sceNpService(); +void Regester_sceNpAuth(); \ No newline at end of file diff --git a/Core/HLE/scePauth.cpp b/Core/HLE/scePauth.cpp new file mode 100644 index 000000000000..eca152a17bf1 --- /dev/null +++ b/Core/HLE/scePauth.cpp @@ -0,0 +1,42 @@ +// 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 "HLE.h" + +#include "scePauth.h" + +int scePauth_F7AA47F6(u32 srcPtr, int srcLength, u32 destLengthPtr, u32 workArea) +{ + ERROR_LOG(HLE, "UNIMPL scePauth_F7AA47F6(%d, %d, %d, %d)", srcPtr, srcLength, destLengthPtr, workArea); + return 0; +} + +int scePauth_98B83B5D(u32 srcPtr, int srcLength, u32 destLengthPtr, u32 workArea) +{ + ERROR_LOG(HLE, "UNIMPL scePauth_98B83B5D(%d, %d, %d, %d)", srcPtr, srcLength, destLengthPtr, workArea); + return 0; +} + +const HLEFunction scePauth[] = { + {0xF7AA47F6, &WrapI_UIUU, "scePauth_F7AA47F6"}, + {0x98B83B5D, &WrapI_UIUU, "scePauth_98B83B5D"}, +}; + +void Register_scePauth() +{ + RegisterModule("scePauth", ARRAY_SIZE(scePauth), scePauth); +} \ No newline at end of file diff --git a/Core/HLE/scePauth.h b/Core/HLE/scePauth.h new file mode 100644 index 000000000000..9256c7c5d5fb --- /dev/null +++ b/Core/HLE/scePauth.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_scePauth(); \ No newline at end of file diff --git a/Core/HLE/sceRtc.cpp b/Core/HLE/sceRtc.cpp index e2694e58df53..18425bd70771 100644 --- a/Core/HLE/sceRtc.cpp +++ b/Core/HLE/sceRtc.cpp @@ -797,46 +797,56 @@ int sceRtcParseDateTime(u32 destTickPtr, u32 dateStringPtr) return 0; } +int sceRtcGetLastAdjustedTime(u32 tickPtr) +{ + u64 curTick = __RtcGetCurrentTick(); + if (Memory::IsValidAddress(tickPtr)) + Memory::Write_U64(curTick, tickPtr); + DEBUG_LOG(HLE, "sceRtcGetLastAdjustedTime(%d)", tickPtr); + return 0; +} + const HLEFunction sceRtc[] = { - {0xC41C2853, WrapU_V, "sceRtcGetTickResolution"}, - {0x3f7ad767, WrapU_U, "sceRtcGetCurrentTick"}, - {0x011F03C1, WrapU64_V, "sceRtcGetAccumulativeTime"}, - {0x029CA3B3, WrapU64_V, "sceRtcGetAccumlativeTime"}, - {0x4cfa57b0, WrapU_UI, "sceRtcGetCurrentClock"}, - {0xE7C27D1B, WrapU_U, "sceRtcGetCurrentClockLocalTime"}, - {0x34885E0D, WrapI_UU, "sceRtcConvertUtcToLocalTime"}, - {0x779242A2, WrapI_UU, "sceRtcConvertLocalTimeToUTC"}, - {0x42307A17, WrapU_U, "sceRtcIsLeapYear"}, - {0x05ef322c, WrapU_UU, "sceRtcGetDaysInMonth"}, - {0x57726bc1, WrapU_UUU, "sceRtcGetDayOfWeek"}, - {0x4B1B5E82, WrapI_U, "sceRtcCheckValid"}, - {0x3a807cc8, WrapI_UU, "sceRtcSetTime_t"}, - {0x27c4594c, WrapI_UU, "sceRtcGetTime_t"}, - {0xF006F264, WrapI_UU, "sceRtcSetDosTime"}, - {0x36075567, WrapI_UU, "sceRtcGetDosTime"}, - {0x7ACE4C04, WrapI_UU, "sceRtcSetWin32FileTime"}, - {0xCF561893, WrapI_UU, "sceRtcGetWin32FileTime"}, - {0x7ED29E40, WrapU_UU, "sceRtcSetTick"}, - {0x6FF40ACC, WrapU_UU, "sceRtcGetTick"}, - {0x9ED0AE87, WrapI_UU, "sceRtcCompareTick"}, - {0x44F45E05, WrapI_UUU64, "sceRtcTickAddTicks"}, - {0x26D25A5D, WrapI_UUU64, "sceRtcTickAddMicroseconds"}, - {0xF2A4AFE5, WrapI_UUU64, "sceRtcTickAddSeconds"}, - {0xE6605BCA, WrapI_UUU64, "sceRtcTickAddMinutes"}, - {0x26D7A24A, WrapI_UUI, "sceRtcTickAddHours"}, - {0xE51B4B7A, WrapI_UUI, "sceRtcTickAddDays"}, - {0xCF3A2CA8, WrapI_UUI, "sceRtcTickAddWeeks"}, - {0xDBF74F1B, WrapI_UUI, "sceRtcTickAddMonths"}, - {0x42842C77, WrapI_UUI, "sceRtcTickAddYears"}, + {0xC41C2853, &WrapU_V, "sceRtcGetTickResolution"}, + {0x3f7ad767, &WrapU_U, "sceRtcGetCurrentTick"}, + {0x011F03C1, &WrapU64_V, "sceRtcGetAccumulativeTime"}, + {0x029CA3B3, &WrapU64_V, "sceRtcGetAccumlativeTime"}, + {0x4cfa57b0, &WrapU_UI, "sceRtcGetCurrentClock"}, + {0xE7C27D1B, &WrapU_U, "sceRtcGetCurrentClockLocalTime"}, + {0x34885E0D, &WrapI_UU, "sceRtcConvertUtcToLocalTime"}, + {0x779242A2, &WrapI_UU, "sceRtcConvertLocalTimeToUTC"}, + {0x42307A17, &WrapU_U, "sceRtcIsLeapYear"}, + {0x05ef322c, &WrapU_UU, "sceRtcGetDaysInMonth"}, + {0x57726bc1, &WrapU_UUU, "sceRtcGetDayOfWeek"}, + {0x4B1B5E82, &WrapI_U, "sceRtcCheckValid"}, + {0x3a807cc8, &WrapI_UU, "sceRtcSetTime_t"}, + {0x27c4594c, &WrapI_UU, "sceRtcGetTime_t"}, + {0xF006F264, &WrapI_UU, "sceRtcSetDosTime"}, + {0x36075567, &WrapI_UU, "sceRtcGetDosTime"}, + {0x7ACE4C04, &WrapI_UU, "sceRtcSetWin32FileTime"}, + {0xCF561893, &WrapI_UU, "sceRtcGetWin32FileTime"}, + {0x7ED29E40, &WrapU_UU, "sceRtcSetTick"}, + {0x6FF40ACC, &WrapU_UU, "sceRtcGetTick"}, + {0x9ED0AE87, &WrapI_UU, "sceRtcCompareTick"}, + {0x44F45E05, &WrapI_UUU64, "sceRtcTickAddTicks"}, + {0x26D25A5D, &WrapI_UUU64, "sceRtcTickAddMicroseconds"}, + {0xF2A4AFE5, &WrapI_UUU64, "sceRtcTickAddSeconds"}, + {0xE6605BCA, &WrapI_UUU64, "sceRtcTickAddMinutes"}, + {0x26D7A24A, &WrapI_UUI, "sceRtcTickAddHours"}, + {0xE51B4B7A, &WrapI_UUI, "sceRtcTickAddDays"}, + {0xCF3A2CA8, &WrapI_UUI, "sceRtcTickAddWeeks"}, + {0xDBF74F1B, &WrapI_UUI, "sceRtcTickAddMonths"}, + {0x42842C77, &WrapI_UUI, "sceRtcTickAddYears"}, {0xC663B3B9, 0, "sceRtcFormatRFC2822"}, {0x7DE6711B, 0, "sceRtcFormatRFC2822LocalTime"}, {0x0498FB3C, 0, "sceRtcFormatRFC3339"}, {0x27F98543, 0, "sceRtcFormatRFC3339LocalTime"}, - {0xDFBC5F16, WrapI_UU, "sceRtcParseDateTime"}, + {0xDFBC5F16, &WrapI_UU, "sceRtcParseDateTime"}, {0x28E1E988, 0, "sceRtcParseRFC3339"}, - {0xe1c93e47, WrapI_UU, "sceRtcGetTime64_t"}, - {0x1909c99b, WrapI_UU64, "sceRtcSetTime64_t"}, + {0xe1c93e47, &WrapI_UU, "sceRtcGetTime64_t"}, + {0x1909c99b, &WrapI_UU64, "sceRtcSetTime64_t"}, + {0x62685E98, &WrapI_U, "sceRtcGetLastAdjustedTime"}, }; void Register_sceRtc() diff --git a/Core/HLE/sceRtc.h b/Core/HLE/sceRtc.h index 7e2af30e5cbc..cfba0c4ece48 100644 --- a/Core/HLE/sceRtc.h +++ b/Core/HLE/sceRtc.h @@ -18,6 +18,7 @@ #pragma once void sceRtcGetCurrentTick(); +int sceRtcGetLastAdjustedTime(u32 tickPtr); void Register_sceRtc(); struct ScePspDateTime { diff --git a/Core/HLE/sceUtility.cpp b/Core/HLE/sceUtility.cpp index 57c4ebdd7737..a7eb97dda95b 100644 --- a/Core/HLE/sceUtility.cpp +++ b/Core/HLE/sceUtility.cpp @@ -470,6 +470,30 @@ void sceUtilityInstallInitStart(u32 unknown) DEBUG_LOG(HLE,"FAKE sceUtilityInstallInitStart()"); } +int sceUtilityStoreCheckoutShutdownStart() +{ + ERROR_LOG(HLE,"UNIMPL sceUtilityStoreCheckoutShutdownStart()"); + return 0; +} + +int sceUtilityStoreCheckoutInitStart(u32 paramsPtr) +{ + ERROR_LOG(HLE,"UNIMPL sceUtilityStoreCheckoutInitStart(%d)", paramsPtr); + return 0; +} + +int sceUtilityStoreCheckoutUpdate(int drawSpeed) +{ + ERROR_LOG(HLE,"UNIMPL sceUtilityStoreCheckoutUpdate(%d)", drawSpeed); + return 0; +} + +int sceUtilityStoreCheckoutGetStatus() +{ + ERROR_LOG(HLE,"UNIMPL sceUtilityStoreCheckoutGetStatus()"); + return 0; +} + const HLEFunction sceUtility[] = { {0x1579a159, &WrapU_U, "sceUtilityLoadNetModule"}, @@ -552,6 +576,10 @@ const HLEFunction sceUtility[] = {0xA03D29BA, 0, "sceUtilityInstallUpdate"}, {0xC4700FA3, 0, "sceUtilityInstallGetStatus"}, + {0x54A5C62F, &WrapI_V, "sceUtilityStoreCheckoutShutdownStart"}, + {0xDA97F1AA, &WrapI_U, "sceUtilityStoreCheckoutInitStart"}, + {0xB8592D5F, &WrapI_I, "sceUtilityStoreCheckoutUpdate"}, + {0x3AAD51DC, &WrapI_V, "sceUtilityStoreCheckoutGetStatus"}, }; void Register_sceUtility() diff --git a/android/jni/Android.mk b/android/jni/Android.mk index b814dc59c723..894483c1ce1d 100644 --- a/android/jni/Android.mk +++ b/android/jni/Android.mk @@ -229,6 +229,8 @@ LOCAL_SRC_FILES := \ $(SRC)/Core/HLE/sceVaudio.cpp \ $(SRC)/Core/HLE/scePspNpDrm_user.cpp \ $(SRC)/Core/HLE/sceGameUpdate.cpp \ + $(SRC)/Core/HLE/sceNp.cpp \ + $(SRC)/Core/HLE/scePauth.cpp \ $(SRC)/Core/FileSystems/BlockDevices.cpp \ $(SRC)/Core/FileSystems/ISOFileSystem.cpp \ $(SRC)/Core/FileSystems/MetaFileSystem.cpp \