From d671afdef4d5d17cb480ae6547ba651cc7ac639e Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Fri, 9 Nov 2012 12:31:58 +0100 Subject: [PATCH] sceImpose --- Core/CMakeLists.txt | 1 + Core/Core.vcxproj | 2 ++ Core/Core.vcxproj.filters | 6 +++++ Core/HLE/HLETables.cpp | 11 ++------- Core/HLE/sceImpose.cpp | 45 ++++++++++++++++++++++++++++++++++++ Core/HLE/sceImpose.h | 20 ++++++++++++++++ Core/HLE/sceKernelThread.cpp | 2 +- android/jni/Android.mk | 1 + 8 files changed, 78 insertions(+), 10 deletions(-) create mode 100644 Core/HLE/sceImpose.cpp create mode 100644 Core/HLE/sceImpose.h diff --git a/Core/CMakeLists.txt b/Core/CMakeLists.txt index ddf9d850f5..bbf5e38704 100644 --- a/Core/CMakeLists.txt +++ b/Core/CMakeLists.txt @@ -25,6 +25,7 @@ set(SRCS HLE/sceGe.cpp HLE/sceHprm.cpp HLE/sceHttp.cpp + HLE/sceImpose.cpp HLE/sceIo.cpp HLE/sceKernel.cpp HLE/sceKernelAlarm.cpp diff --git a/Core/Core.vcxproj b/Core/Core.vcxproj index 85b308eb11..426a12c298 100644 --- a/Core/Core.vcxproj +++ b/Core/Core.vcxproj @@ -135,6 +135,7 @@ + @@ -264,6 +265,7 @@ + diff --git a/Core/Core.vcxproj.filters b/Core/Core.vcxproj.filters index ebf5ad45bd..a29237c2a8 100644 --- a/Core/Core.vcxproj.filters +++ b/Core/Core.vcxproj.filters @@ -288,6 +288,9 @@ HW + + HLE\Libraries + @@ -524,6 +527,9 @@ HW + + HLE\Libraries + diff --git a/Core/HLE/HLETables.cpp b/Core/HLE/HLETables.cpp index 9ebf97064e..de45d71c0b 100644 --- a/Core/HLE/HLETables.cpp +++ b/Core/HLE/HLETables.cpp @@ -28,6 +28,7 @@ #include "scePower.h" #include "sceNet.h" #include "sceMpeg.h" +#include "sceImpose.h" #include "sceGe.h" #include "scePsmf.h" #include "sceRtc.h" @@ -277,14 +278,6 @@ const HLEFunction sceUsbstorBoot[] = {0xA55C9E16, 0, "sceUsbstorBootUnregisterNotify"}, }; -//OSD stuff? home button? -const HLEFunction sceImpose[] = -{ - {0x36aa6e91, 0, "sceImposeSetLanguageMode"}, // Seen - {0x381bd9e7, 0, "sceImposeHomeButton"}, - {0x24fd7bcf, 0, "sceImposeGetLanguageMode"}, - {0x8c943191, 0, "sceImposeGetBatteryIconStatus"}, -}; const HLEFunction sceOpenPSID[] = { @@ -314,7 +307,6 @@ const HLEModule moduleList[] = {"sceSsl"}, {"sceSIRCS_IrDA_Driver"}, {"sceRtc"}, - {"sceImpose",SZ(sceImpose),sceImpose}, //r: [UNK:36aa6e91] : 08b2cd68 //305: [MIPS32 R4K 00000000 ]: Loader: [UNK:24fd7bcf] : 08b2cd70 {"Pspnet_Scan"}, {"Pspnet_Show_MacAddr"}, {"pspeDebug", SZ(pspeDebug), pspeDebug}, @@ -346,6 +338,7 @@ void RegisterAllModules() { Register_sceMp3(); Register_sceHttp(); Register_scePower(); + Register_sceImpose(); Register_sceSuspendForUser(); Register_sceGe_user(); Register_sceUmdUser(); diff --git a/Core/HLE/sceImpose.cpp b/Core/HLE/sceImpose.cpp new file mode 100644 index 0000000000..d6b0a17182 --- /dev/null +++ b/Core/HLE/sceImpose.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 "FunctionWrappers.h" +#include "../MIPS/MIPS.h" + +u32 sceImposeGetBatteryIconStatus(u32 chargingPtr, u32 iconStatusPtr) +{ + DEBUG_LOG(HLE,"%i=sceImposeGetBatteryIconStatus(%08x, %08x)", chargingPtr, iconStatusPtr); + if (Memory::IsValidAddress(chargingPtr)) + Memory::Write_U32(1, chargingPtr); + if (Memory::IsValidAddress(iconStatusPtr)) + Memory::Write_U32(3, iconStatusPtr); + return 0; +} + + +//OSD stuff? home button? +const HLEFunction sceImpose[] = +{ + {0x36aa6e91, 0, "sceImposeSetLanguageMode"}, // Seen + {0x381bd9e7, 0, "sceImposeHomeButton"}, + {0x24fd7bcf, 0, "sceImposeGetLanguageMode"}, + {0x8c943191, &WrapU_UU, "sceImposeGetBatteryIconStatus"}, +}; + +void Register_sceImpose() +{ + RegisterModule("sceImpose", ARRAY_SIZE(sceImpose), sceImpose); +} diff --git a/Core/HLE/sceImpose.h b/Core/HLE/sceImpose.h new file mode 100644 index 0000000000..1de2aea93e --- /dev/null +++ b/Core/HLE/sceImpose.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_sceImpose(); diff --git a/Core/HLE/sceKernelThread.cpp b/Core/HLE/sceKernelThread.cpp index 3c97fbbaf4..c6002b6191 100644 --- a/Core/HLE/sceKernelThread.cpp +++ b/Core/HLE/sceKernelThread.cpp @@ -1696,7 +1696,7 @@ u32 __KernelUnregisterCallback(RegisteredCallbackType type, SceUID cbId) t->registeredCallbacks[type].erase(cbId); return 0; } else { - return SCE_KERNEL_ERROR_INVAL; + return 0x80010016; } } diff --git a/android/jni/Android.mk b/android/jni/Android.mk index 740156e8c9..5b0680bccf 100644 --- a/android/jni/Android.mk +++ b/android/jni/Android.mk @@ -104,6 +104,7 @@ LOCAL_SRC_FILES := \ $(SRC)/Core/HLE/sceGe.cpp \ $(SRC)/Core/HLE/sceHprm.cpp \ $(SRC)/Core/HLE/sceHttp.cpp \ + $(SRC)/Core/HLE/sceImpose.cpp \ $(SRC)/Core/HLE/sceIo.cpp \ $(SRC)/Core/HLE/sceKernel.cpp \ $(SRC)/Core/HLE/sceKernelAlarm.cpp \