From 9bcb67f90b55d3462e69902bcbacc6c435541096 Mon Sep 17 00:00:00 2001 From: TMaul Date: Thu, 6 Dec 2012 15:24:25 +0000 Subject: [PATCH 1/4] Add some missing sce* Functions Add the missing functions to sceHttp Create sceOpenPSID and add what jpcsp is doing Create sceParseHttp.cpp Create sceParseUri.cpp Create sceSsl.cpp and add what jpcsp is doing reindent some files. in an attempt to try and get a few games doing more. --- Core/CMakeLists.txt | 4 + Core/Core.vcxproj | 8 ++ Core/Core.vcxproj.filters | 24 ++++++ Core/HLE/HLETables.cpp | 167 ++++++++++++++++++-------------------- Core/HLE/sceHttp.cpp | 13 ++- Core/HLE/sceKernel.cpp | 2 + Core/HLE/sceOpenPSID.cpp | 45 ++++++++++ Core/HLE/sceOpenPSID.h | 22 +++++ Core/HLE/sceParseHttp.cpp | 31 +++++++ Core/HLE/sceParseHttp.h | 20 +++++ Core/HLE/sceParseUri.cpp | 33 ++++++++ Core/HLE/sceParseUri.h | 20 +++++ Core/HLE/sceSsl.cpp | 116 ++++++++++++++++++++++++++ Core/HLE/sceSsl.h | 22 +++++ 14 files changed, 438 insertions(+), 89 deletions(-) create mode 100644 Core/HLE/sceOpenPSID.cpp create mode 100644 Core/HLE/sceOpenPSID.h create mode 100644 Core/HLE/sceParseHttp.cpp create mode 100644 Core/HLE/sceParseHttp.h create mode 100644 Core/HLE/sceParseUri.cpp create mode 100644 Core/HLE/sceParseUri.h create mode 100644 Core/HLE/sceSsl.cpp create mode 100644 Core/HLE/sceSsl.h diff --git a/Core/CMakeLists.txt b/Core/CMakeLists.txt index 8428959a2f..2eccf3734d 100644 --- a/Core/CMakeLists.txt +++ b/Core/CMakeLists.txt @@ -50,6 +50,10 @@ set(SRCS HLE/sceSas.cpp HLE/sceUmd.cpp HLE/sceUtility.cpp + HLE/sceParseUri.cpp + HLE/sceSsl.cpp + HLE/sceParseUri.cpp + HLE/sceParseHttp.cpp HW/MemoryStick.cpp FileSystems/BlockDevices.cpp FileSystems/ISOFileSystem.cpp diff --git a/Core/Core.vcxproj b/Core/Core.vcxproj index 6b8f518c3d..26009c4320 100644 --- a/Core/Core.vcxproj +++ b/Core/Core.vcxproj @@ -154,10 +154,14 @@ + + + + @@ -287,10 +291,14 @@ + + + + diff --git a/Core/Core.vcxproj.filters b/Core/Core.vcxproj.filters index 65452343d1..dec29d774c 100644 --- a/Core/Core.vcxproj.filters +++ b/Core/Core.vcxproj.filters @@ -303,6 +303,18 @@ ELF + + HLE\Libraries + + + HLE\Libraries + + + HLE\Libraries + + + HLE\Libraries + @@ -554,6 +566,18 @@ ELF + + HLE\Libraries + + + HLE\Libraries + + + HLE\Libraries + + + HLE\Libraries + diff --git a/Core/HLE/HLETables.cpp b/Core/HLE/HLETables.cpp index f3b1fb7d71..6b99782d2f 100644 --- a/Core/HLE/HLETables.cpp +++ b/Core/HLE/HLETables.cpp @@ -37,6 +37,7 @@ #include "sceUmd.h" #include "sceDmac.h" #include "sceRtc.h" +#include "sceOpenPSID.h" #include "sceKernel.h" #include "sceKernelEventFlag.h" #include "sceKernelMemory.h" @@ -47,6 +48,9 @@ #include "sceKernelTime.h" #include "sceAudio.h" #include "sceUtility.h" +#include "sceParseUri.h" +#include "sceSsl.h" +#include "sceParseHttp.h" #define N(s) s @@ -59,10 +63,10 @@ //zlibdec const HLEFunction FakeSysCalls[] = { - {NID_THREADRETURN, __KernelReturnFromThread, "__KernelReturnFromThread"}, - {NID_CALLBACKRETURN, __KernelReturnFromMipsCall, "__KernelReturnFromMipsCall"}, + {NID_THREADRETURN, __KernelReturnFromThread, "__KernelReturnFromThread"}, + {NID_CALLBACKRETURN, __KernelReturnFromMipsCall, "__KernelReturnFromMipsCall"}, {NID_INTERRUPTRETURN, __KernelReturnFromInterrupt, "__KernelReturnFromInterrupt"}, - {NID_IDLE, __KernelIdle, "_sceKernelIdle"}, + {NID_IDLE, __KernelIdle, "_sceKernelIdle"}, }; const HLEFunction UtilsForUser[] = @@ -98,51 +102,51 @@ const HLEFunction UtilsForUser[] = const HLEFunction IoFileMgrForKernel[] = { - {0xa905b705, 0, "sceIoCloseAll"}, - {0x411106BA, 0, "sceIoGetThreadCwd"}, - {0xCB0A151F, 0, "sceIoChangeThreadCwd"}, - {0x8E982A74, 0, "sceIoAddDrv"}, - {0xC7F35804, 0, "sceIoDelDrv"}, - {0x3C54E908, 0, "sceIoReopen"}, + {0xa905b705, 0, "sceIoCloseAll"}, + {0x411106BA, 0, "sceIoGetThreadCwd"}, + {0xCB0A151F, 0, "sceIoChangeThreadCwd"}, + {0x8E982A74, 0, "sceIoAddDrv"}, + {0xC7F35804, 0, "sceIoDelDrv"}, + {0x3C54E908, 0, "sceIoReopen"}, }; const HLEFunction StdioForKernel[] = { - {0x98220F3E, 0, "sceKernelStdoutReopen"}, - {0xFB5380C5, 0, "sceKernelStderrReopen"}, - {0x2CCF071A, 0, "fdprintf"}, + {0x98220F3E, 0, "sceKernelStdoutReopen"}, + {0xFB5380C5, 0, "sceKernelStderrReopen"}, + {0x2CCF071A, 0, "fdprintf"}, }; const HLEFunction LoadCoreForKernel[] = { - {0xACE23476, 0, "sceKernelCheckPspConfig"}, - {0x7BE1421C, 0, "sceKernelCheckExecFile"}, - {0xBF983EF2, 0, "sceKernelProbeExecutableObject"}, - {0x7068E6BA, 0, "sceKernelLoadExecutableObject"}, - {0xB4D6FECC, 0, "sceKernelApplyElfRelSection"}, - {0x54AB2675, 0, "LoadCoreForKernel_54AB2675"}, - {0x2952F5AC, 0, "sceKernelDcacheWBinvAll"}, - {0xD8779AC6, sceKernelIcacheClearAll, "sceKernelIcacheClearAll"}, - {0x99A695F0, 0, "sceKernelRegisterLibrary"}, - {0x5873A31F, 0, "sceKernelRegisterLibraryForUser"}, - {0x0B464512, 0, "sceKernelReleaseLibrary"}, - {0x9BAF90F6, 0, "sceKernelCanReleaseLibrary"}, - {0x0E760DBA, 0, "sceKernelLinkLibraryEntries"}, - {0x0DE1F600, 0, "sceKernelLinkLibraryEntriesForUser"}, - {0xDA1B09AA, 0, "sceKernelUnLinkLibraryEntries"}, - {0xC99DD47A, 0, "sceKernelQueryLoadCoreCB"}, - {0x616FCCCD, 0, "sceKernelSetBootCallbackLevel"}, - {0xF32A2940, 0, "sceKernelModuleFromUID"}, - {0xCD0F3BAC, 0, "sceKernelCreateModule"}, - {0x6B2371C2, 0, "sceKernelDeleteModule"}, - {0x7320D964, 0, "sceKernelModuleAssign"}, - {0x44B292AB, 0, "sceKernelAllocModule"}, - {0xBD61D4D5, 0, "sceKernelFreeModule"}, - {0xAE7C6E76, 0, "sceKernelRegisterModule"}, - {0x74CF001A, 0, "sceKernelReleaseModule"}, - {0xFB8AE27D, 0, "sceKernelFindModuleByAddress"}, - {0xCCE4A157, 0, "sceKernelFindModuleByUID"}, - {0x82CE54ED, 0, "sceKernelModuleCount"}, - {0xC0584F0C, 0, "sceKernelGetModuleList"}, - {0xCF8A41B1, sceKernelFindModuleByName,"sceKernelFindModuleByName"}, + {0xACE23476, 0, "sceKernelCheckPspConfig"}, + {0x7BE1421C, 0, "sceKernelCheckExecFile"}, + {0xBF983EF2, 0, "sceKernelProbeExecutableObject"}, + {0x7068E6BA, 0, "sceKernelLoadExecutableObject"}, + {0xB4D6FECC, 0, "sceKernelApplyElfRelSection"}, + {0x54AB2675, 0, "LoadCoreForKernel_54AB2675"}, + {0x2952F5AC, 0, "sceKernelDcacheWBinvAll"}, + {0xD8779AC6, sceKernelIcacheClearAll, "sceKernelIcacheClearAll"}, + {0x99A695F0, 0, "sceKernelRegisterLibrary"}, + {0x5873A31F, 0, "sceKernelRegisterLibraryForUser"}, + {0x0B464512, 0, "sceKernelReleaseLibrary"}, + {0x9BAF90F6, 0, "sceKernelCanReleaseLibrary"}, + {0x0E760DBA, 0, "sceKernelLinkLibraryEntries"}, + {0x0DE1F600, 0, "sceKernelLinkLibraryEntriesForUser"}, + {0xDA1B09AA, 0, "sceKernelUnLinkLibraryEntries"}, + {0xC99DD47A, 0, "sceKernelQueryLoadCoreCB"}, + {0x616FCCCD, 0, "sceKernelSetBootCallbackLevel"}, + {0xF32A2940, 0, "sceKernelModuleFromUID"}, + {0xCD0F3BAC, 0, "sceKernelCreateModule"}, + {0x6B2371C2, 0, "sceKernelDeleteModule"}, + {0x7320D964, 0, "sceKernelModuleAssign"}, + {0x44B292AB, 0, "sceKernelAllocModule"}, + {0xBD61D4D5, 0, "sceKernelFreeModule"}, + {0xAE7C6E76, 0, "sceKernelRegisterModule"}, + {0x74CF001A, 0, "sceKernelReleaseModule"}, + {0xFB8AE27D, 0, "sceKernelFindModuleByAddress"}, + {0xCCE4A157, 0, "sceKernelFindModuleByUID"}, + {0x82CE54ED, 0, "sceKernelModuleCount"}, + {0xC0584F0C, 0, "sceKernelGetModuleList"}, + {0xCF8A41B1, sceKernelFindModuleByName,"sceKernelFindModuleByName"}, }; @@ -191,7 +195,6 @@ const HLEFunction sceUsb[] = {0x5be0e002, 0, "sceUsbWaitState"}, {0x1c360735, 0, "sceUsbWaitCancel"}, }; - const HLEFunction sceUsbstor[] = { @@ -208,20 +211,11 @@ const HLEFunction sceUsbstorBoot[] = {0xA55C9E16, 0, "sceUsbstorBootUnregisterNotify"}, }; - -const HLEFunction sceOpenPSID[] = -{ - {0xc69bebce, 0, "sceOpenPSID_c69bebce"}, -}; - - const HLEModule moduleList[] = { {"FakeSysCalls", SZ(FakeSysCalls), FakeSysCalls}, - {"sceOpenPSID", SZ(sceOpenPSID), sceOpenPSID}, {"UtilsForUser",SZ(UtilsForUser),UtilsForUser}, {"KDebugForKernel",SZ(KDebugForKernel),KDebugForKernel}, - {"sceParseUri"}, {"sceSAScore"}, {"sceUsbstor",SZ(sceUsbstor),sceUsbstor}, {"sceUsbstorBoot",SZ(sceUsbstorBoot),sceUsbstorBoot}, @@ -230,9 +224,6 @@ const HLEModule moduleList[] = {"sceCert_Loader"}, {"SceFont_Library"}, {"sceNetApctl"}, - {"sceOpenPSID"}, - {"sceParseHttp"}, - {"sceSsl"}, {"sceSIRCS_IrDA_Driver"}, {"Pspnet_Scan"}, {"Pspnet_Show_MacAddr"}, @@ -245,41 +236,45 @@ const HLEModule moduleList[] = static const int numModules = sizeof(moduleList)/sizeof(HLEModule); void RegisterAllModules() { - Register_Kernel_Library(); - Register_ThreadManForUser(); - Register_LoadExecForUser(); - Register_SysMemUserForUser(); - Register_InterruptManager(); - Register_IoFileMgrForUser(); - Register_ModuleMgrForUser(); - Register_StdioForUser(); + Register_Kernel_Library(); + Register_ThreadManForUser(); + Register_LoadExecForUser(); + Register_SysMemUserForUser(); + Register_InterruptManager(); + Register_IoFileMgrForUser(); + Register_ModuleMgrForUser(); + Register_StdioForUser(); - Register_sceHprm(); - Register_sceCtrl(); - Register_sceDisplay(); - Register_sceAudio(); - Register_sceSasCore(); + Register_sceHprm(); + Register_sceCtrl(); + Register_sceDisplay(); + Register_sceAudio(); + Register_sceSasCore(); Register_sceFont(); Register_sceNet(); - Register_sceRtc(); - Register_sceWlanDrv(); - Register_sceMpeg(); - Register_sceMp3(); - Register_sceHttp(); - Register_scePower(); + Register_sceRtc(); + Register_sceWlanDrv(); + Register_sceMpeg(); + Register_sceMp3(); + Register_sceHttp(); + Register_scePower(); Register_sceImpose(); - Register_sceSuspendForUser(); - Register_sceGe_user(); - Register_sceUmdUser(); - Register_sceDmac(); - Register_sceUtility(); - Register_sceAtrac3plus(); - Register_scePsmf(); - Register_scePsmfPlayer(); + Register_sceSuspendForUser(); + Register_sceGe_user(); + Register_sceUmdUser(); + Register_sceDmac(); + Register_sceUtility(); + Register_sceAtrac3plus(); + Register_scePsmf(); + Register_scePsmfPlayer(); + Register_sceOpenPSID(); + Register_sceParseUri(); + Register_sceSsl(); + Register_sceParseHttp(); - for (int i = 0; i < numModules; i++) - { - RegisterModule(moduleList[i].name, moduleList[i].numFunctions, moduleList[i].funcTable); - } + for (int i = 0; i < numModules; i++) + { + RegisterModule(moduleList[i].name, moduleList[i].numFunctions, moduleList[i].funcTable); + } } diff --git a/Core/HLE/sceHttp.cpp b/Core/HLE/sceHttp.cpp index 8fbf7b90ab..ffc1205528 100644 --- a/Core/HLE/sceHttp.cpp +++ b/Core/HLE/sceHttp.cpp @@ -65,9 +65,16 @@ const HLEFunction sceHttp[] = {0xae948fee,0,"sceHttpDisableAuth"}, {0xccbd167a,0,"sceHttpDisableCache"}, {0xd081ec8f,0,"sceHttpGetNetworkErrno"}, - {0x76d1363b,0,"sceHttp_76d1363b"}, - {0x87797bdd,0,"sceHttp_87797bdd"}, - {0xf1657b22,0,"sceHttp_f1657b22"}, + {0x76d1363b,0,"sceHttpSaveSystemCookie"}, + {0x87797bdd,0,"sceHttpsLoadDefaultCert"}, + {0xf1657b22,0,"sceHttpLoadSystemCookie"}, + {0x9B1F1F36,0,"sceHttpCreateTemplate"}, + {0xB509B09E,0,"sceHttpCreateRequestWithURL"}, + {0xCDF8ECB9,0,"sceHttpCreateConnectionWithURL"}, + {0x1F0FC3E3,0,"sceHttpSetRecvTimeOut"}, + {0xDB266CCF,0,"sceHttpGetAllHeader"}, + {0x68AB0F86,0,"sceHttpsInitWithPath"}, + {0xB3FAF831,0,"sceHttpsDisableOption"}, }; void Register_sceHttp() diff --git a/Core/HLE/sceKernel.cpp b/Core/HLE/sceKernel.cpp index 955c89c771..d1d783b288 100644 --- a/Core/HLE/sceKernel.cpp +++ b/Core/HLE/sceKernel.cpp @@ -49,6 +49,7 @@ #include "scePower.h" #include "sceUtility.h" #include "sceUmd.h" +#include "sceSsl.h" #include "../Util/PPGeDraw.h" @@ -82,6 +83,7 @@ void __KernelInit() __UtilityInit(); __UmdInit(); __CtrlInit(); + __SslInit(); // "Internal" PSP libraries __PPGeInit(); diff --git a/Core/HLE/sceOpenPSID.cpp b/Core/HLE/sceOpenPSID.cpp new file mode 100644 index 0000000000..41241440ba --- /dev/null +++ b/Core/HLE/sceOpenPSID.cpp @@ -0,0 +1,45 @@ +// 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 "sceOpenPSID.h" + +int sceOpenPSIDGetOpenPSID(u32 OpenPSIDPtr) +{ + ERROR_LOG(HLE, "UNTESTED sceOpenPSIDGetOpenPSID(%d)", OpenPSIDPtr); + u8 dummyOpenPSID[16] = {0x10, 0x02, 0xA3, 0x44, 0x13, 0xF5, 0x93, 0xB0, 0xCC, 0x6E, 0xD1, 0x32, 0x27, 0x85, 0x0F, 0x9D}; + + if (Memory::IsValidAddress(OpenPSIDPtr)) + { + for (int i = 0; i < 16; i++) + { + Memory::Write_U8(dummyOpenPSID[i], OpenPSIDPtr+i); + } + } + return 0; +} + +const HLEFunction sceOpenPSID[] = +{ + {0xc69bebce, WrapI_U, "sceOpenPSIDGetOpenPSID"}, +}; + +void Register_sceOpenPSID() +{ + RegisterModule("sceOpenPSID", ARRAY_SIZE(sceOpenPSID), sceOpenPSID); +} \ No newline at end of file diff --git a/Core/HLE/sceOpenPSID.h b/Core/HLE/sceOpenPSID.h new file mode 100644 index 0000000000..07c5171e59 --- /dev/null +++ b/Core/HLE/sceOpenPSID.h @@ -0,0 +1,22 @@ +// 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 __sceOpenPSIDInit(); + +void Register_sceOpenPSID(); diff --git a/Core/HLE/sceParseHttp.cpp b/Core/HLE/sceParseHttp.cpp new file mode 100644 index 0000000000..6ad04ec026 --- /dev/null +++ b/Core/HLE/sceParseHttp.cpp @@ -0,0 +1,31 @@ +// 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 "sceParseHttp.h" + +const HLEFunction sceParseHttp [] = +{ + {0x8077A433, 0, "sceParseHttpStatusLineFunction"}, + {0xAD7BFDEF, 0, "sceParseHttpResponseHeaderFunction"}, +}; + +void Register_sceParseHttp() +{ + RegisterModule("sceParseHttp", ARRAY_SIZE(sceParseHttp), sceParseHttp); +} \ No newline at end of file diff --git a/Core/HLE/sceParseHttp.h b/Core/HLE/sceParseHttp.h new file mode 100644 index 0000000000..6c67a246b2 --- /dev/null +++ b/Core/HLE/sceParseHttp.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_sceParseHttp(); \ No newline at end of file diff --git a/Core/HLE/sceParseUri.cpp b/Core/HLE/sceParseUri.cpp new file mode 100644 index 0000000000..10268b47a9 --- /dev/null +++ b/Core/HLE/sceParseUri.cpp @@ -0,0 +1,33 @@ +// 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 "sceParseUri.h" + +const HLEFunction sceParseUri[] = +{ + {0x49E950EC, 0, "sceUriEscapeFunction"}, + {0x062BB07E, 0, "sceUriUnescapeFunction"}, + {0x568518C9, 0, "sceUriParseFunction"}, + {0x7EE318AF, 0, "sceUriBuildFunction"}, +}; + +void Register_sceParseUri() +{ + RegisterModule("sceParseUri", ARRAY_SIZE(sceParseUri), sceParseUri); +} \ No newline at end of file diff --git a/Core/HLE/sceParseUri.h b/Core/HLE/sceParseUri.h new file mode 100644 index 0000000000..5108cd0219 --- /dev/null +++ b/Core/HLE/sceParseUri.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_sceParseUri(); \ No newline at end of file diff --git a/Core/HLE/sceSsl.cpp b/Core/HLE/sceSsl.cpp new file mode 100644 index 0000000000..0a762af122 --- /dev/null +++ b/Core/HLE/sceSsl.cpp @@ -0,0 +1,116 @@ +// 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 "sceSsl.h" + +#define ERROR_SSL_NOT_INIT 0x80435001; +#define ERROR_SSL_ALREADY_INIT 0x80435020; +#define ERROR_SSL_OUT_OF_MEMORY 0x80435022; +#define ERROR_SSL_INVALID_PARAMETER 0x804351FE; + +bool isSslInit; +u32 maxMemSize; +u32 currentMemSize; + +void __SslInit() +{ + isSslInit = 0; + maxMemSize = 0; + currentMemSize = 0; +} + +int sceSslInit(int heapSize) +{ + DEBUG_LOG(HLE, "sceSslInit %d", heapSize); + if (isSslInit) + { + return ERROR_SSL_ALREADY_INIT; + } + if (heapSize <= 0) + { + return ERROR_SSL_INVALID_PARAMETER; + } + + maxMemSize = heapSize; + currentMemSize = heapSize / 2; // As per jpcsp + isSslInit = true; + return 0; +} + +int sceSslEnd() +{ + DEBUG_LOG(HLE, "sceSslEnd"); + if (!isSslInit) + { + return ERROR_SSL_NOT_INIT; + } + isSslInit = false; + return 0; +} + +int sceSslGetUsedMemoryMax(u32 maxMemPtr) +{ + DEBUG_LOG(HLE, "sceSslGetUsedMemoryMax %d", maxMemPtr); + if (!isSslInit) + { + return ERROR_SSL_NOT_INIT; + } + + if (Memory::IsValidAddress(maxMemPtr)) + { + Memory::Write_U32(maxMemSize, maxMemPtr); + } + return 0; +} + +int sceSslGetUsedMemoryCurrent(u32 currentMemPtr) +{ + DEBUG_LOG(HLE, "sceSslGetUsedMemoryCurrent %d", currentMemPtr); + if (!isSslInit) + { + return ERROR_SSL_NOT_INIT; + } + + if (Memory::IsValidAddress(currentMemPtr)) + { + Memory::Write_U32(currentMemSize, currentMemPtr); + } + return 0; +} + +const HLEFunction sceSsl[] = +{ + {0x957ECBE2, WrapI_I, "sceSslInit"}, + {0x191CDEFF, WrapI_V, "sceSslEnd"}, + {0x5BFB6B61, 0, "sceSslGetNotAfter"}, + {0x17A10DCC, 0, "sceSslGetNotBefore"}, + {0x3DD5E023, 0, "sceSslGetSubjectName"}, + {0x1B7C8191, 0, "sceSslGetIssuerName"}, + {0xCC0919B0, 0, "sceSslGetSerialNumber"}, + {0x058D21C0, 0, "sceSslGetNameEntryCount"}, + {0xD6D097B4, 0, "sceSslGetNameEntryInfo"}, + {0xB99EDE6A, WrapI_U, "sceSslGetUsedMemoryMax"}, + {0x0EB43B06, WrapI_U, "sceSslGetUsedMemoryCurrent"}, + {0xF57765D3, 0, "sceSslGetKeyUsage"}, +}; + +void Register_sceSsl() +{ + RegisterModule("sceSsl", ARRAY_SIZE(sceSsl), sceSsl); +} \ No newline at end of file diff --git a/Core/HLE/sceSsl.h b/Core/HLE/sceSsl.h new file mode 100644 index 0000000000..c8e46f976b --- /dev/null +++ b/Core/HLE/sceSsl.h @@ -0,0 +1,22 @@ +// 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_sceSsl(); + +void __SslInit(); \ No newline at end of file From 0efde68d740d7af1cfa953b3b2863584a21ea583 Mon Sep 17 00:00:00 2001 From: TMaul Date: Thu, 6 Dec 2012 16:03:39 +0000 Subject: [PATCH 2/4] Add another sceNetStub sceNetInetSocketAbort this time --- Core/HLE/sceNet.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Core/HLE/sceNet.cpp b/Core/HLE/sceNet.cpp index 84d60e5748..2830ced468 100644 --- a/Core/HLE/sceNet.cpp +++ b/Core/HLE/sceNet.cpp @@ -171,6 +171,7 @@ const HLEFunction sceNetInet[] = {0x4a114c7c, 0, "sceNetInetGetsockopt"}, {0xfaabb1dd, 0, "sceNetInetPoll"}, {0x1BDF5D13, 0, "sceNetInetInetAton"}, + {0x80A21ABD, 0, "sceNetInetSocketAbort"}, }; const HLEFunction sceNetApctl[] = { From a737f70caeadc222f7f92ff73cbf1fdbb27d5a04 Mon Sep 17 00:00:00 2001 From: TMaul Date: Thu, 6 Dec 2012 16:58:59 +0000 Subject: [PATCH 3/4] Fake scesupPreAcc Gets Dissidia Final Fantasy to title screen. We will need to make this one go away by getting PRX loading working properly I think. --- Core/CMakeLists.txt | 1 + Core/Core.vcxproj | 2 ++ Core/Core.vcxproj.filters | 6 ++++++ Core/HLE/HLETables.cpp | 2 ++ Core/HLE/sceOpenPSID.cpp | 2 +- Core/HLE/scesupPreAcc.cpp | 38 ++++++++++++++++++++++++++++++++++++++ Core/HLE/scesupPreAcc.h | 21 +++++++++++++++++++++ 7 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 Core/HLE/scesupPreAcc.cpp create mode 100644 Core/HLE/scesupPreAcc.h diff --git a/Core/CMakeLists.txt b/Core/CMakeLists.txt index 2eccf3734d..824acb84cd 100644 --- a/Core/CMakeLists.txt +++ b/Core/CMakeLists.txt @@ -54,6 +54,7 @@ set(SRCS HLE/sceSsl.cpp HLE/sceParseUri.cpp HLE/sceParseHttp.cpp + HLE/scesupPreAcc.cpp HW/MemoryStick.cpp FileSystems/BlockDevices.cpp FileSystems/ISOFileSystem.cpp diff --git a/Core/Core.vcxproj b/Core/Core.vcxproj index 26009c4320..9ded6c257a 100644 --- a/Core/Core.vcxproj +++ b/Core/Core.vcxproj @@ -162,6 +162,7 @@ + @@ -299,6 +300,7 @@ + diff --git a/Core/Core.vcxproj.filters b/Core/Core.vcxproj.filters index dec29d774c..4cddd043e7 100644 --- a/Core/Core.vcxproj.filters +++ b/Core/Core.vcxproj.filters @@ -315,6 +315,9 @@ HLE\Libraries + + HLE\Libraries + @@ -578,6 +581,9 @@ HLE\Libraries + + HLE\Libraries + diff --git a/Core/HLE/HLETables.cpp b/Core/HLE/HLETables.cpp index 6b99782d2f..ce63298216 100644 --- a/Core/HLE/HLETables.cpp +++ b/Core/HLE/HLETables.cpp @@ -51,6 +51,7 @@ #include "sceParseUri.h" #include "sceSsl.h" #include "sceParseHttp.h" +#include "scesupPreAcc.h" #define N(s) s @@ -271,6 +272,7 @@ void RegisterAllModules() { Register_sceParseUri(); Register_sceSsl(); Register_sceParseHttp(); + Register_scesupPreAcc(); for (int i = 0; i < numModules; i++) { diff --git a/Core/HLE/sceOpenPSID.cpp b/Core/HLE/sceOpenPSID.cpp index 41241440ba..60161dcb57 100644 --- a/Core/HLE/sceOpenPSID.cpp +++ b/Core/HLE/sceOpenPSID.cpp @@ -42,4 +42,4 @@ const HLEFunction sceOpenPSID[] = void Register_sceOpenPSID() { RegisterModule("sceOpenPSID", ARRAY_SIZE(sceOpenPSID), sceOpenPSID); -} \ No newline at end of file +} diff --git a/Core/HLE/scesupPreAcc.cpp b/Core/HLE/scesupPreAcc.cpp new file mode 100644 index 0000000000..564b656b39 --- /dev/null +++ b/Core/HLE/scesupPreAcc.cpp @@ -0,0 +1,38 @@ +// 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 "scesupPreAcc.h" + +const HLEFunction scesupPreAcc[] = +{ + {0x110e318b, 0, "scesupPreAcc_0x110e318b"}, + {0x13ae25b3, 0, "scesupPreAcc_0x13ae25b3"}, + {0x28c5f696, 0, "scesupPreAcc_0x28c5f696"}, + {0x348ba3e2, 0, "scesupPreAcc_0x348ba3e2"}, + {0x86debd66, 0, "scesupPreAcc_0x86debd66"}, + {0xa0eaf444, 0, "scesupPreAcc_0xa0eaf444"}, + {0xb03ff882, 0, "scesupPreAcc_0xb03ff882"}, + {0x2ec3f4d9, 0, "scesupPreAcc_0x2ec3f4d9"}, + +}; + +void Register_scesupPreAcc() +{ + RegisterModule("scesupPreAcc",ARRAY_SIZE(scesupPreAcc), scesupPreAcc ); +} diff --git a/Core/HLE/scesupPreAcc.h b/Core/HLE/scesupPreAcc.h new file mode 100644 index 0000000000..311e679bd8 --- /dev/null +++ b/Core/HLE/scesupPreAcc.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_scesupPreAcc(); + From ea21789d34aa7aeaa668e447a381228a935b36e4 Mon Sep 17 00:00:00 2001 From: TMaul Date: Thu, 6 Dec 2012 17:44:33 +0000 Subject: [PATCH 4/4] Fake sceDisplayWaitVblankStartMulti And stub the sceVaudio fuctions called by DOA paradise --- Core/CMakeLists.txt | 1 + Core/Core.vcxproj | 2 ++ Core/Core.vcxproj.filters | 6 ++++++ Core/HLE/HLETables.cpp | 2 ++ Core/HLE/sceDisplay.cpp | 9 ++++++++- Core/HLE/sceVaudio.cpp | 32 ++++++++++++++++++++++++++++++++ Core/HLE/sceVaudio.h | 21 +++++++++++++++++++++ 7 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 Core/HLE/sceVaudio.cpp create mode 100644 Core/HLE/sceVaudio.h diff --git a/Core/CMakeLists.txt b/Core/CMakeLists.txt index 824acb84cd..7b36e268cc 100644 --- a/Core/CMakeLists.txt +++ b/Core/CMakeLists.txt @@ -55,6 +55,7 @@ set(SRCS HLE/sceParseUri.cpp HLE/sceParseHttp.cpp HLE/scesupPreAcc.cpp + HLE/sceVaudio.cpp HW/MemoryStick.cpp FileSystems/BlockDevices.cpp FileSystems/ISOFileSystem.cpp diff --git a/Core/Core.vcxproj b/Core/Core.vcxproj index 9ded6c257a..a1243f56bb 100644 --- a/Core/Core.vcxproj +++ b/Core/Core.vcxproj @@ -165,6 +165,7 @@ + @@ -304,6 +305,7 @@ + diff --git a/Core/Core.vcxproj.filters b/Core/Core.vcxproj.filters index 4cddd043e7..8d9ce20db5 100644 --- a/Core/Core.vcxproj.filters +++ b/Core/Core.vcxproj.filters @@ -318,6 +318,9 @@ HLE\Libraries + + HLE\Libraries + @@ -584,6 +587,9 @@ HLE\Libraries + + HLE\Libraries + diff --git a/Core/HLE/HLETables.cpp b/Core/HLE/HLETables.cpp index ce63298216..67d1ef8d9e 100644 --- a/Core/HLE/HLETables.cpp +++ b/Core/HLE/HLETables.cpp @@ -52,6 +52,7 @@ #include "sceSsl.h" #include "sceParseHttp.h" #include "scesupPreAcc.h" +#include "sceVaudio.h" #define N(s) s @@ -273,6 +274,7 @@ void RegisterAllModules() { Register_sceSsl(); Register_sceParseHttp(); Register_scesupPreAcc(); + Register_sceVaudio(); for (int i = 0; i < numModules; i++) { diff --git a/Core/HLE/sceDisplay.cpp b/Core/HLE/sceDisplay.cpp index 5e42caebe4..f8a0609c6b 100644 --- a/Core/HLE/sceDisplay.cpp +++ b/Core/HLE/sceDisplay.cpp @@ -327,6 +327,12 @@ void sceDisplayWaitVblank() __KernelWaitCurThread(WAITTYPE_VBLANK, 0, 0, 0, false); } +void sceDisplayWaitVblankStartMulti() +{ + DEBUG_LOG(HLE,"sceDisplayWaitVblankStartMulti()"); + __KernelWaitCurThread(WAITTYPE_VBLANK, 0, 0, 0, false); +} + void sceDisplayWaitVblankCB() { DEBUG_LOG(HLE,"sceDisplayWaitVblankCB()"); @@ -385,10 +391,10 @@ const HLEFunction sceDisplay[] = {0xEEDA2E54,&WrapU_UUUI,"sceDisplayGetFrameBuf"}, {0x36CDFADE,sceDisplayWaitVblank, "sceDisplayWaitVblank"}, {0x984C27E7,sceDisplayWaitVblankStart, "sceDisplayWaitVblankStart"}, + {0x40f1469c,sceDisplayWaitVblankStartMulti, "sceDisplayWaitVblankStartMulti"}, {0x8EB9EC49,sceDisplayWaitVblankCB, "sceDisplayWaitVblankCB"}, {0x46F186C3,sceDisplayWaitVblankStartCB, "sceDisplayWaitVblankStartCB"}, {0x77ed8b3a,sceDisplayWaitVblankStartMultiCB,"sceDisplayWaitVblankStartMultiCB"}, - {0xdba6c4c4,&WrapF_V,"sceDisplayGetFramePerSec"}, {0x773dd3a3,sceDisplayGetCurrentHcount,"sceDisplayGetCurrentHcount"}, {0x210eab3a,sceDisplayGetAccumulatedHcount,"sceDisplayGetAccumulatedHcount"}, @@ -399,6 +405,7 @@ const HLEFunction sceDisplay[] = {0xB4F378FA,0,"sceDisplayIsForeground"}, {0x31C4BAA8,0,"sceDisplayGetBrightness"}, {0x4D4E10EC,sceDisplayIsVblank,"sceDisplayIsVblank"}, + }; void Register_sceDisplay() diff --git a/Core/HLE/sceVaudio.cpp b/Core/HLE/sceVaudio.cpp new file mode 100644 index 0000000000..6ca72b69d0 --- /dev/null +++ b/Core/HLE/sceVaudio.cpp @@ -0,0 +1,32 @@ +// 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 "sceVaudio.h" + +const HLEFunction sceVaudio[] = +{ + {0x03b6807d, 0, "sceVaudio_0x03b6807d"}, + {0x67585dfd, 0, "sceVaudio_0x67585dfd"}, + {0x8986295e, 0, "sceVaudio_0x8986295e"}, +}; + +void Register_sceVaudio() +{ + RegisterModule("sceVaudio",ARRAY_SIZE(sceVaudio), sceVaudio ); +} diff --git a/Core/HLE/sceVaudio.h b/Core/HLE/sceVaudio.h new file mode 100644 index 0000000000..ef5d7c951a --- /dev/null +++ b/Core/HLE/sceVaudio.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_sceVaudio(); +