Skip to content

Commit

Permalink
Merge pull request #1586 from nachume/imaspatch
Browse files Browse the repository at this point in the history
Add new sceNp/scePauth and some stubs for unknown functions on THE IDOLM...
  • Loading branch information
hrydgard committed Apr 29, 2013
2 parents 8561531 + c89589c commit 3534f7b
Show file tree
Hide file tree
Showing 16 changed files with 297 additions and 37 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions Core/Core.vcxproj
Expand Up @@ -201,9 +201,11 @@
<ClCompile Include="HLE\sceKernelVTimer.cpp" />
<ClCompile Include="HLE\sceMpeg.cpp" />
<ClCompile Include="HLE\sceNet.cpp" />
<ClCompile Include="HLE\sceNp.cpp" />
<ClCompile Include="HLE\sceOpenPSID.cpp" />
<ClCompile Include="HLE\sceParseHttp.cpp" />
<ClCompile Include="HLE\sceParseUri.cpp" />
<ClCompile Include="HLE\scePauth.cpp" />
<ClCompile Include="HLE\scePower.cpp" />
<ClCompile Include="HLE\scePsmf.cpp" />
<ClCompile Include="HLE\scePspNpDrm_user.cpp" />
Expand Down Expand Up @@ -371,9 +373,11 @@
<ClInclude Include="HLE\sceKernelTime.h" />
<ClInclude Include="HLE\sceMpeg.h" />
<ClInclude Include="HLE\sceNet.h" />
<ClInclude Include="HLE\sceNp.h" />
<ClInclude Include="HLE\sceOpenPSID.h" />
<ClInclude Include="HLE\sceParseHttp.h" />
<ClInclude Include="HLE\sceParseUri.h" />
<ClInclude Include="HLE\scePauth.h" />
<ClInclude Include="HLE\scePower.h" />
<ClInclude Include="HLE\scePsmf.h" />
<ClInclude Include="HLE\scePspNpDrm_user.h" />
Expand Down
14 changes: 13 additions & 1 deletion Core/Core.vcxproj.filters
Expand Up @@ -401,6 +401,12 @@
<Filter>ELF</Filter>
</ClCompile>
<ClCompile Include="MIPS\JitCommon\JitBlockCache.cpp" />
<ClCompile Include="HLE\scePauth.cpp">
<Filter>HLE\Libraries</Filter>
</ClCompile>
<ClCompile Include="HLE\sceNp.cpp">
<Filter>HLE\Libraries</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="ELF\ElfReader.h">
Expand Down Expand Up @@ -740,11 +746,17 @@
<Filter>ELF</Filter>
</ClInclude>
<ClInclude Include="MIPS\JitCommon\JitBlockCache.h" />
<ClInclude Include="HLE\scePauth.h">
<Filter>HLE\Libraries</Filter>
</ClInclude>
<ClInclude Include="HLE\sceNp.h">
<Filter>HLE\Libraries</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="CMakeLists.txt" />
<None Include="..\LICENSE.TXT" />
<None Include="..\android\jni\Android.mk" />
<None Include="GameLogNotes.txt" />
</ItemGroup>
</Project>
</Project>
7 changes: 7 additions & 0 deletions Core/HLE/HLETables.cpp
Expand Up @@ -59,6 +59,8 @@
#include "sceGameUpdate.h"
#include "sceDeflt.h"
#include "sceMp4.h"
#include "scePauth.h"
#include "sceNp.h"

#define N(s) s

Expand Down Expand Up @@ -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++)
{
Expand Down
6 changes: 6 additions & 0 deletions Core/HLE/sceHttp.cpp
Expand Up @@ -19,6 +19,11 @@

#include "sceHttp.h"

int sceHttpSetResolveRetry(int connectionID, int retryCount)
{
ERROR_LOG(HLE, "UNIMPL sceHttpSetResolveRetry()");
return 0;
}

/*
* 0x62411801 sceSircsInit
Expand Down Expand Up @@ -55,6 +60,7 @@ const HLEFunction sceHttp[] = {
{0xc10b6bd9,0,"sceHttpAbortRequest"},
{0xfcf8c055,0,"sceHttpDeleteTemplate"},
{0xf49934f6,0,"sceHttpSetMallocFunction"},
{0x03D9526F,&WrapI_II<sceHttpSetResolveRetry>, "sceHttpSetResolveRetry"},
{0x47940436,0,"sceHttpSetResolveTimeOut"},
{0x2a6c3296,0,"sceHttpSetAuthInfoCB"},
{0xd081ec8f,0,"sceHttpGetNetworkErrno"},
Expand Down
2 changes: 2 additions & 0 deletions Core/HLE/sceHttp.h
Expand Up @@ -17,4 +17,6 @@

#pragma once

int sceHttpSetResolveRetry(int connectionID, int retryCount);

void Register_sceHttp();
10 changes: 8 additions & 2 deletions Core/HLE/sceKernel.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -812,6 +817,7 @@ const HLEFunction LoadExecForUser[] =
{0x4AC57943,&WrapU_U<sceKernelRegisterExitCallback>,"sceKernelRegisterExitCallback"},
{0xBD2F1094,&WrapI_CU<sceKernelLoadExec>,"sceKernelLoadExec"},
{0x2AC9954B,&WrapV_V<sceKernelExitGameWithStatus>,"sceKernelExitGameWithStatus"},
{0x362A956B,&WrapI_V<LoadExecForUser_362A956B>, "LoadExecForUser_362A956B"},
};

void Register_LoadExecForUser()
Expand Down
4 changes: 3 additions & 1 deletion Core/HLE/sceKernel.h
Expand Up @@ -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();
Expand Down
91 changes: 91 additions & 0 deletions 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>, "sceNp_857B47D3"},
{0x37E1E274, &WrapI_V<sceNp_37E1E274>, "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);
}
23 changes: 23 additions & 0 deletions 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();
42 changes: 42 additions & 0 deletions 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>, "scePauth_F7AA47F6"},
{0x98B83B5D, &WrapI_UIUU<scePauth_98B83B5D>, "scePauth_98B83B5D"},
};

void Register_scePauth()
{
RegisterModule("scePauth", ARRAY_SIZE(scePauth), scePauth);
}
20 changes: 20 additions & 0 deletions 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();

0 comments on commit 3534f7b

Please sign in to comment.