2012-11-01 15:19:01 +00:00
|
|
|
// 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
|
2012-11-04 22:01:49 +00:00
|
|
|
// the Free Software Foundation, version 2.0 or later versions.
|
2012-11-01 15:19:01 +00:00
|
|
|
|
|
|
|
// 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/.
|
|
|
|
|
2013-12-29 23:11:29 +00:00
|
|
|
#include <algorithm>
|
2013-04-22 06:35:57 +00:00
|
|
|
#include <set>
|
|
|
|
|
2013-12-29 22:28:31 +00:00
|
|
|
#include "file/ini_file.h"
|
2012-11-01 15:19:01 +00:00
|
|
|
|
2013-12-29 22:28:31 +00:00
|
|
|
#include "Common/ChunkFile.h"
|
|
|
|
#include "Core/HLE/HLE.h"
|
2014-03-15 18:22:19 +00:00
|
|
|
#include "Core/HLE/FunctionWrappers.h"
|
2013-12-29 22:28:31 +00:00
|
|
|
#include "Core/MIPS/MIPS.h"
|
|
|
|
#include "Core/Reporting.h"
|
2014-03-15 17:38:46 +00:00
|
|
|
#include "Core/Config.h"
|
2012-11-01 15:19:01 +00:00
|
|
|
|
2013-12-29 22:28:31 +00:00
|
|
|
#include "Core/HLE/sceKernel.h"
|
|
|
|
#include "Core/HLE/sceKernelThread.h"
|
|
|
|
#include "Core/HLE/sceUtility.h"
|
|
|
|
|
|
|
|
#include "Core/HLE/sceCtrl.h"
|
|
|
|
#include "Core/Util/PPGeDraw.h"
|
|
|
|
#include "Core/Dialog/PSPSaveDialog.h"
|
|
|
|
#include "Core/Dialog/PSPMsgDialog.h"
|
|
|
|
#include "Core/Dialog/PSPPlaceholderDialog.h"
|
|
|
|
#include "Core/Dialog/PSPOskDialog.h"
|
|
|
|
#include "Core/Dialog/PSPGamedataInstallDialog.h"
|
|
|
|
#include "Core/Dialog/PSPNetconfDialog.h"
|
2013-09-26 01:05:44 +00:00
|
|
|
|
2013-03-08 06:25:07 +00:00
|
|
|
const int SCE_ERROR_MODULE_BAD_ID = 0x80111101;
|
2013-04-22 06:35:57 +00:00
|
|
|
const int SCE_ERROR_MODULE_ALREADY_LOADED = 0x80111102;
|
|
|
|
const int SCE_ERROR_MODULE_NOT_LOADED = 0x80111103;
|
2013-03-09 20:53:53 +00:00
|
|
|
const int SCE_ERROR_AV_MODULE_BAD_ID = 0x80110F01;
|
2013-10-27 01:52:56 +00:00
|
|
|
const u32 PSP_MODULE_NET_HTTP = 261;
|
|
|
|
const u32 PSP_MODULE_NET_HTTPSTORAGE = 264;
|
2013-03-08 06:25:07 +00:00
|
|
|
|
2013-03-18 02:01:58 +00:00
|
|
|
enum UtilityDialogType {
|
|
|
|
UTILITY_DIALOG_NONE,
|
|
|
|
UTILITY_DIALOG_SAVEDATA,
|
|
|
|
UTILITY_DIALOG_MSG,
|
|
|
|
UTILITY_DIALOG_OSK,
|
|
|
|
UTILITY_DIALOG_NET,
|
2013-08-31 21:34:36 +00:00
|
|
|
UTILITY_DIALOG_SCREENSHOT,
|
|
|
|
UTILITY_DIALOG_GAMESHARING,
|
2013-09-13 15:07:43 +00:00
|
|
|
UTILITY_DIALOG_GAMEDATAINSTALL,
|
2013-03-18 02:01:58 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// Only a single dialog is allowed at a time.
|
|
|
|
static UtilityDialogType currentDialogType;
|
|
|
|
static bool currentDialogActive;
|
|
|
|
static PSPSaveDialog saveDialog;
|
|
|
|
static PSPMsgDialog msgDialog;
|
|
|
|
static PSPOskDialog oskDialog;
|
2013-10-13 02:43:49 +00:00
|
|
|
static PSPNetconfDialog netDialog;
|
2013-06-12 09:20:08 +00:00
|
|
|
static PSPPlaceholderDialog screenshotDialog;
|
2013-09-13 15:07:43 +00:00
|
|
|
static PSPGamedataInstallDialog gamedataInstallDialog;
|
2012-11-01 15:19:01 +00:00
|
|
|
|
2013-04-22 06:35:57 +00:00
|
|
|
static std::set<int> currentlyLoadedModules;
|
|
|
|
|
2012-11-01 15:19:01 +00:00
|
|
|
void __UtilityInit()
|
2012-12-24 09:41:15 +00:00
|
|
|
{
|
2013-03-18 02:01:58 +00:00
|
|
|
currentDialogType = UTILITY_DIALOG_NONE;
|
|
|
|
currentDialogActive = false;
|
2012-12-24 09:41:15 +00:00
|
|
|
SavedataParam::Init();
|
2013-04-22 06:35:57 +00:00
|
|
|
currentlyLoadedModules.clear();
|
2012-12-24 09:41:15 +00:00
|
|
|
}
|
|
|
|
|
2012-12-28 21:36:37 +00:00
|
|
|
void __UtilityDoState(PointerWrap &p)
|
|
|
|
{
|
2013-09-15 03:23:03 +00:00
|
|
|
auto s = p.Section("sceUtility", 1);
|
|
|
|
if (!s)
|
|
|
|
return;
|
|
|
|
|
2013-03-18 02:01:58 +00:00
|
|
|
p.Do(currentDialogType);
|
|
|
|
p.Do(currentDialogActive);
|
2012-12-28 21:36:37 +00:00
|
|
|
saveDialog.DoState(p);
|
|
|
|
msgDialog.DoState(p);
|
|
|
|
oskDialog.DoState(p);
|
|
|
|
netDialog.DoState(p);
|
2013-06-17 23:55:43 +00:00
|
|
|
screenshotDialog.DoState(p);
|
2013-09-13 15:07:43 +00:00
|
|
|
gamedataInstallDialog.DoState(p);
|
2013-04-22 06:35:57 +00:00
|
|
|
p.Do(currentlyLoadedModules);
|
2012-12-28 21:36:37 +00:00
|
|
|
}
|
|
|
|
|
2012-12-24 09:41:15 +00:00
|
|
|
void __UtilityShutdown()
|
2012-11-01 15:19:01 +00:00
|
|
|
{
|
2013-05-31 08:07:37 +00:00
|
|
|
saveDialog.Shutdown(true);
|
|
|
|
msgDialog.Shutdown(true);
|
|
|
|
oskDialog.Shutdown(true);
|
|
|
|
netDialog.Shutdown(true);
|
2013-06-17 23:55:43 +00:00
|
|
|
screenshotDialog.Shutdown(true);
|
2013-09-13 15:07:43 +00:00
|
|
|
gamedataInstallDialog.Shutdown(true);
|
2012-11-01 15:19:01 +00:00
|
|
|
}
|
|
|
|
|
2013-05-01 15:14:41 +00:00
|
|
|
int __UtilityGetStatus()
|
|
|
|
{
|
|
|
|
if (currentDialogType == UTILITY_DIALOG_NONE) {
|
|
|
|
return 0;
|
|
|
|
} else {
|
2013-09-07 19:19:21 +00:00
|
|
|
WARN_LOG(SCEUTILITY, "__UtilityGetStatus() Faked dialog : wrong dialog type");
|
2013-05-01 15:14:41 +00:00
|
|
|
return SCE_ERROR_UTILITY_WRONG_TYPE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-11-22 20:46:22 +00:00
|
|
|
int sceUtilitySavedataInitStart(u32 paramAddr)
|
2012-11-01 15:19:01 +00:00
|
|
|
{
|
2013-03-18 02:01:58 +00:00
|
|
|
if (currentDialogActive && currentDialogType != UTILITY_DIALOG_SAVEDATA)
|
|
|
|
{
|
2013-09-07 19:19:21 +00:00
|
|
|
WARN_LOG(SCEUTILITY, "sceUtilitySavedataInitStart(%08x): wrong dialog type", paramAddr);
|
2013-03-18 02:01:58 +00:00
|
|
|
return SCE_ERROR_UTILITY_WRONG_TYPE;
|
|
|
|
}
|
|
|
|
currentDialogType = UTILITY_DIALOG_SAVEDATA;
|
|
|
|
currentDialogActive = true;
|
2014-01-31 23:25:41 +00:00
|
|
|
int ret = saveDialog.Init(paramAddr);
|
|
|
|
DEBUG_LOG(SCEUTILITY,"%08x=sceUtilitySavedataInitStart(%08x)",ret,paramAddr);
|
|
|
|
return ret;
|
2012-11-01 15:19:01 +00:00
|
|
|
}
|
|
|
|
|
2012-11-22 20:46:22 +00:00
|
|
|
int sceUtilitySavedataShutdownStart()
|
2012-11-01 15:19:01 +00:00
|
|
|
{
|
2013-03-18 02:01:58 +00:00
|
|
|
if (currentDialogType != UTILITY_DIALOG_SAVEDATA)
|
|
|
|
{
|
2013-09-07 19:19:21 +00:00
|
|
|
WARN_LOG(SCEUTILITY, "sceUtilitySavedataShutdownStart(): wrong dialog type");
|
2013-03-18 02:01:58 +00:00
|
|
|
return SCE_ERROR_UTILITY_WRONG_TYPE;
|
|
|
|
}
|
|
|
|
currentDialogActive = false;
|
2014-01-31 23:25:41 +00:00
|
|
|
int ret = saveDialog.Shutdown();
|
|
|
|
DEBUG_LOG(SCEUTILITY,"%08x=sceUtilitySavedataShutdownStart()",ret);
|
|
|
|
return ret;
|
2012-11-01 15:19:01 +00:00
|
|
|
}
|
|
|
|
|
2012-11-22 20:46:22 +00:00
|
|
|
int sceUtilitySavedataGetStatus()
|
2012-11-01 15:19:01 +00:00
|
|
|
{
|
2013-03-18 02:01:58 +00:00
|
|
|
if (currentDialogType != UTILITY_DIALOG_SAVEDATA)
|
|
|
|
{
|
2013-09-07 19:19:21 +00:00
|
|
|
DEBUG_LOG(SCEUTILITY, "sceUtilitySavedataGetStatus(): wrong dialog type");
|
2014-03-15 08:18:35 +00:00
|
|
|
hleEatCycles(200);
|
2013-03-18 02:01:58 +00:00
|
|
|
return SCE_ERROR_UTILITY_WRONG_TYPE;
|
|
|
|
}
|
|
|
|
|
2013-03-18 00:49:37 +00:00
|
|
|
int status = saveDialog.GetStatus();
|
2013-09-07 19:19:21 +00:00
|
|
|
DEBUG_LOG(SCEUTILITY, "%08x=sceUtilitySavedataGetStatus()", status);
|
2014-03-15 08:18:35 +00:00
|
|
|
hleEatCycles(200);
|
2013-03-18 00:49:37 +00:00
|
|
|
return status;
|
2012-12-08 22:39:47 +00:00
|
|
|
}
|
|
|
|
|
2012-12-25 02:37:28 +00:00
|
|
|
int sceUtilitySavedataUpdate(int animSpeed)
|
2012-12-08 22:39:47 +00:00
|
|
|
{
|
2013-03-18 02:01:58 +00:00
|
|
|
if (currentDialogType != UTILITY_DIALOG_SAVEDATA)
|
|
|
|
{
|
2013-09-07 19:19:21 +00:00
|
|
|
WARN_LOG(SCEUTILITY, "sceUtilitySavedataUpdate(): wrong dialog type");
|
2013-03-18 02:01:58 +00:00
|
|
|
return SCE_ERROR_UTILITY_WRONG_TYPE;
|
|
|
|
}
|
2014-01-31 23:25:41 +00:00
|
|
|
|
2013-10-16 16:54:17 +00:00
|
|
|
int result = saveDialog.Update(animSpeed);
|
2014-01-31 23:25:41 +00:00
|
|
|
DEBUG_LOG(SCEUTILITY,"%08x=sceUtilitySavedataUpdate(%d)",result,animSpeed);
|
2013-03-18 04:39:06 +00:00
|
|
|
if (result >= 0)
|
|
|
|
return hleDelayResult(result, "savedata update", 300);
|
|
|
|
return result;
|
2012-11-01 15:19:01 +00:00
|
|
|
}
|
2012-11-22 20:46:22 +00:00
|
|
|
|
2014-03-03 16:16:53 +00:00
|
|
|
#define PSP_AV_MODULE_AVCODEC 0
|
|
|
|
#define PSP_AV_MODULE_SASCORE 1
|
|
|
|
#define PSP_AV_MODULE_ATRAC3PLUS 2 // Requires PSP_AV_MODULE_AVCODEC loading first
|
|
|
|
#define PSP_AV_MODULE_MPEGBASE 3 // Requires PSP_AV_MODULE_AVCODEC loading first
|
|
|
|
#define PSP_AV_MODULE_MP3 4
|
|
|
|
#define PSP_AV_MODULE_VAUDIO 5
|
|
|
|
#define PSP_AV_MODULE_AAC 6
|
|
|
|
#define PSP_AV_MODULE_G729 7
|
2012-11-01 15:19:01 +00:00
|
|
|
|
2012-12-31 12:43:38 +00:00
|
|
|
u32 sceUtilityLoadAvModule(u32 module)
|
2012-11-01 15:19:01 +00:00
|
|
|
{
|
2013-03-09 20:53:53 +00:00
|
|
|
if (module > 7)
|
|
|
|
{
|
2013-09-07 19:19:21 +00:00
|
|
|
ERROR_LOG_REPORT(SCEUTILITY, "sceUtilityLoadAvModule(%i): invalid module id", module);
|
2013-03-09 20:53:53 +00:00
|
|
|
return SCE_ERROR_AV_MODULE_BAD_ID;
|
|
|
|
}
|
|
|
|
|
2014-01-31 23:25:41 +00:00
|
|
|
DEBUG_LOG(SCEUTILITY,"0=sceUtilityLoadAvModule(%i)", module);
|
2013-03-09 20:53:53 +00:00
|
|
|
return hleDelayResult(0, "utility av module loaded", 25000);
|
2012-12-31 12:43:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
u32 sceUtilityUnloadAvModule(u32 module)
|
|
|
|
{
|
2014-01-31 23:25:41 +00:00
|
|
|
DEBUG_LOG(SCEUTILITY,"0=sceUtilityUnloadAvModule(%i)", module);
|
2013-03-09 20:53:53 +00:00
|
|
|
return hleDelayResult(0, "utility av module unloaded", 800);
|
2012-11-01 15:19:01 +00:00
|
|
|
}
|
|
|
|
|
2012-12-31 12:43:38 +00:00
|
|
|
u32 sceUtilityLoadModule(u32 module)
|
2012-11-01 15:19:01 +00:00
|
|
|
{
|
2013-03-08 06:25:07 +00:00
|
|
|
// TODO: Not all modules between 0x100 and 0x601 are valid.
|
|
|
|
if (module < 0x100 || module > 0x601)
|
|
|
|
{
|
2013-09-07 19:19:21 +00:00
|
|
|
ERROR_LOG_REPORT(SCEUTILITY, "sceUtilityLoadModule(%i): invalid module id", module);
|
2013-03-08 06:25:07 +00:00
|
|
|
return SCE_ERROR_MODULE_BAD_ID;
|
|
|
|
}
|
|
|
|
|
2013-04-22 06:35:57 +00:00
|
|
|
if (currentlyLoadedModules.find(module) != currentlyLoadedModules.end())
|
|
|
|
{
|
2013-09-07 19:19:21 +00:00
|
|
|
DEBUG_LOG(SCEUTILITY, "sceUtilityLoadModule(%i): already loaded", module);
|
2013-04-22 06:35:57 +00:00
|
|
|
return SCE_ERROR_MODULE_ALREADY_LOADED;
|
|
|
|
}
|
2013-10-04 23:37:51 +00:00
|
|
|
INFO_LOG(SCEUTILITY, "sceUtilityLoadModule(%i)", module);
|
2013-10-22 13:08:36 +00:00
|
|
|
//Fix Kamen Rider Climax Heroes OOO - ULJS00331 loading
|
|
|
|
//Fix Naruto Shippuden Kizuna Drive (error module load failed)
|
|
|
|
if (module == PSP_MODULE_NET_HTTPSTORAGE && !(currentlyLoadedModules.find(PSP_MODULE_NET_HTTP) != currentlyLoadedModules.end()))
|
|
|
|
{
|
|
|
|
ERROR_LOG(SCEUTILITY, "sceUtilityLoadModule: Library not found");
|
2013-10-05 12:15:44 +00:00
|
|
|
return SCE_KERNEL_ERROR_LIBRARY_NOTFOUND;
|
2013-10-22 13:08:36 +00:00
|
|
|
}
|
2013-03-08 06:25:07 +00:00
|
|
|
// TODO: Each module has its own timing, technically, but this is a low-end.
|
|
|
|
// Note: Some modules have dependencies, but they still resched.
|
2013-10-22 13:08:36 +00:00
|
|
|
|
|
|
|
currentlyLoadedModules.insert(module);
|
|
|
|
|
2013-03-08 06:25:07 +00:00
|
|
|
if (module == 0x3FF)
|
2013-03-09 19:37:57 +00:00
|
|
|
return hleDelayResult(0, "utility module loaded", 130);
|
2013-03-08 06:25:07 +00:00
|
|
|
else
|
2013-03-09 19:37:57 +00:00
|
|
|
return hleDelayResult(0, "utility module loaded", 25000);
|
2012-12-31 12:43:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
u32 sceUtilityUnloadModule(u32 module)
|
|
|
|
{
|
2013-03-08 06:25:07 +00:00
|
|
|
// TODO: Not all modules between 0x100 and 0x601 are valid.
|
|
|
|
if (module < 0x100 || module > 0x601)
|
|
|
|
{
|
2013-09-07 19:19:21 +00:00
|
|
|
ERROR_LOG_REPORT(SCEUTILITY, "sceUtilityUnloadModule(%i): invalid module id", module);
|
2013-03-08 06:25:07 +00:00
|
|
|
return SCE_ERROR_MODULE_BAD_ID;
|
|
|
|
}
|
|
|
|
|
2013-04-22 06:35:57 +00:00
|
|
|
if (currentlyLoadedModules.find(module) == currentlyLoadedModules.end())
|
|
|
|
{
|
2013-10-06 19:16:42 +00:00
|
|
|
WARN_LOG(SCEUTILITY, "sceUtilityUnloadModule(%i): not yet loaded", module);
|
2013-04-22 06:35:57 +00:00
|
|
|
return SCE_ERROR_MODULE_NOT_LOADED;
|
|
|
|
}
|
|
|
|
currentlyLoadedModules.erase(module);
|
|
|
|
|
2013-10-22 12:15:32 +00:00
|
|
|
INFO_LOG(SCEUTILITY, "sceUtilityUnloadModule(%i)", module);
|
2013-03-08 06:25:07 +00:00
|
|
|
// TODO: Each module has its own timing, technically, but this is a low-end.
|
|
|
|
// Note: If not loaded, it should not reschedule actually...
|
|
|
|
if (module == 0x3FF)
|
2013-03-09 19:37:57 +00:00
|
|
|
return hleDelayResult(0, "utility module unloaded", 110);
|
2013-03-08 06:25:07 +00:00
|
|
|
else
|
2013-03-09 19:37:57 +00:00
|
|
|
return hleDelayResult(0, "utility module unloaded", 400);
|
2012-11-01 15:19:01 +00:00
|
|
|
}
|
|
|
|
|
2012-12-25 02:37:28 +00:00
|
|
|
int sceUtilityMsgDialogInitStart(u32 structAddr)
|
2012-11-01 15:19:01 +00:00
|
|
|
{
|
2013-03-18 02:01:58 +00:00
|
|
|
if (currentDialogActive && currentDialogType != UTILITY_DIALOG_MSG)
|
|
|
|
{
|
2013-09-07 19:19:21 +00:00
|
|
|
WARN_LOG(SCEUTILITY, "sceUtilityMsgDialogInitStart(%08x): wrong dialog type", structAddr);
|
2013-03-18 02:01:58 +00:00
|
|
|
return SCE_ERROR_UTILITY_WRONG_TYPE;
|
|
|
|
}
|
|
|
|
currentDialogType = UTILITY_DIALOG_MSG;
|
|
|
|
currentDialogActive = true;
|
2014-01-31 23:25:41 +00:00
|
|
|
int ret = msgDialog.Init(structAddr);
|
2014-02-09 00:01:41 +00:00
|
|
|
INFO_LOG(SCEUTILITY, "%08x=sceUtilityMsgDialogInitStart(%08x)",ret,structAddr);
|
2014-01-31 23:25:41 +00:00
|
|
|
return ret;
|
2012-11-01 15:19:01 +00:00
|
|
|
}
|
|
|
|
|
2013-03-18 02:01:58 +00:00
|
|
|
int sceUtilityMsgDialogShutdownStart()
|
2012-11-01 15:19:01 +00:00
|
|
|
{
|
2013-03-18 02:01:58 +00:00
|
|
|
if (currentDialogType != UTILITY_DIALOG_MSG)
|
|
|
|
{
|
2013-09-07 19:19:21 +00:00
|
|
|
WARN_LOG(SCEUTILITY, "sceUtilityMsgDialogShutdownStart(): wrong dialog type");
|
2013-03-18 02:01:58 +00:00
|
|
|
return SCE_ERROR_UTILITY_WRONG_TYPE;
|
|
|
|
}
|
|
|
|
currentDialogActive = false;
|
2014-01-31 23:25:41 +00:00
|
|
|
int ret = msgDialog.Shutdown();
|
|
|
|
DEBUG_LOG(SCEUTILITY, "%08x=sceUtilityMsgDialogShutdownStart()",ret);
|
|
|
|
return ret;
|
2012-11-01 15:19:01 +00:00
|
|
|
}
|
|
|
|
|
2012-12-25 02:37:28 +00:00
|
|
|
int sceUtilityMsgDialogUpdate(int animSpeed)
|
2012-11-01 15:19:01 +00:00
|
|
|
{
|
2013-03-18 02:01:58 +00:00
|
|
|
if (currentDialogType != UTILITY_DIALOG_MSG)
|
|
|
|
{
|
2013-09-07 19:19:21 +00:00
|
|
|
WARN_LOG(SCEUTILITY, "sceUtilityMsgDialogUpdate(): wrong dialog type");
|
2013-03-18 02:01:58 +00:00
|
|
|
return SCE_ERROR_UTILITY_WRONG_TYPE;
|
|
|
|
}
|
2014-01-31 23:25:41 +00:00
|
|
|
int ret = msgDialog.Update(animSpeed);
|
|
|
|
DEBUG_LOG(SCEUTILITY,"%08x=sceUtilityMsgDialogUpdate(%i)",ret,animSpeed);
|
|
|
|
return ret;
|
2012-11-01 15:19:01 +00:00
|
|
|
}
|
|
|
|
|
2012-12-25 02:37:28 +00:00
|
|
|
int sceUtilityMsgDialogGetStatus()
|
2012-11-01 15:19:01 +00:00
|
|
|
{
|
2013-03-18 02:01:58 +00:00
|
|
|
if (currentDialogType != UTILITY_DIALOG_MSG)
|
|
|
|
{
|
2013-09-07 19:19:21 +00:00
|
|
|
DEBUG_LOG(SCEUTILITY, "sceUtilityMsgDialogGetStatus(): wrong dialog type");
|
2013-03-18 02:01:58 +00:00
|
|
|
return SCE_ERROR_UTILITY_WRONG_TYPE;
|
|
|
|
}
|
|
|
|
|
|
|
|
int status = msgDialog.GetStatus();
|
2013-09-07 19:19:21 +00:00
|
|
|
DEBUG_LOG(SCEUTILITY, "%08x=sceUtilityMsgDialogGetStatus()", status);
|
2013-03-18 02:01:58 +00:00
|
|
|
return status;
|
2012-11-01 15:19:01 +00:00
|
|
|
}
|
|
|
|
|
2013-03-31 05:54:00 +00:00
|
|
|
int sceUtilityMsgDialogAbort()
|
|
|
|
{
|
|
|
|
if (currentDialogType != UTILITY_DIALOG_MSG)
|
|
|
|
{
|
2014-01-22 16:17:21 +00:00
|
|
|
WARN_LOG(SCEUTILITY, "sceUtilityMsgDialogAbort(): wrong dialog type");
|
2013-03-31 05:54:00 +00:00
|
|
|
return SCE_ERROR_UTILITY_WRONG_TYPE;
|
|
|
|
}
|
2014-01-31 23:25:41 +00:00
|
|
|
int ret = msgDialog.Abort();
|
|
|
|
DEBUG_LOG(SCEUTILITY, "%08x=sceUtilityMsgDialogAbort()",ret);
|
|
|
|
return ret;
|
2013-03-31 05:54:00 +00:00
|
|
|
}
|
|
|
|
|
2012-11-18 12:04:49 +00:00
|
|
|
|
|
|
|
// On screen keyboard
|
|
|
|
|
2012-12-15 16:42:38 +00:00
|
|
|
int sceUtilityOskInitStart(u32 oskPtr)
|
2012-11-01 15:19:01 +00:00
|
|
|
{
|
2013-03-18 02:01:58 +00:00
|
|
|
if (currentDialogActive && currentDialogType != UTILITY_DIALOG_OSK)
|
|
|
|
{
|
2013-09-07 19:19:21 +00:00
|
|
|
WARN_LOG(SCEUTILITY, "sceUtilityOskInitStart(%08x): wrong dialog type", oskPtr);
|
2013-03-18 02:01:58 +00:00
|
|
|
return SCE_ERROR_UTILITY_WRONG_TYPE;
|
|
|
|
}
|
|
|
|
currentDialogType = UTILITY_DIALOG_OSK;
|
|
|
|
currentDialogActive = true;
|
2014-01-31 23:25:41 +00:00
|
|
|
int ret = oskDialog.Init(oskPtr);
|
2014-02-08 22:54:12 +00:00
|
|
|
INFO_LOG(SCEUTILITY, "%08x=sceUtilityOskInitStart(%08x)", ret, oskPtr);
|
2014-01-31 23:25:41 +00:00
|
|
|
return ret;
|
2012-11-01 15:19:01 +00:00
|
|
|
}
|
|
|
|
|
2012-12-10 12:08:54 +00:00
|
|
|
int sceUtilityOskShutdownStart()
|
2012-11-01 15:19:01 +00:00
|
|
|
{
|
2013-03-18 02:01:58 +00:00
|
|
|
if (currentDialogType != UTILITY_DIALOG_OSK)
|
|
|
|
{
|
2013-09-07 19:19:21 +00:00
|
|
|
WARN_LOG(SCEUTILITY, "sceUtilityOskShutdownStart(): wrong dialog type");
|
2013-03-18 02:01:58 +00:00
|
|
|
return SCE_ERROR_UTILITY_WRONG_TYPE;
|
|
|
|
}
|
|
|
|
currentDialogActive = false;
|
2014-01-31 23:25:41 +00:00
|
|
|
int ret = oskDialog.Shutdown();
|
|
|
|
DEBUG_LOG(SCEUTILITY, "%08x=sceUtilityOskShutdownStart()",ret);
|
|
|
|
return ret;
|
2012-11-01 15:19:01 +00:00
|
|
|
}
|
|
|
|
|
2013-03-18 02:01:58 +00:00
|
|
|
int sceUtilityOskUpdate(int animSpeed)
|
2012-11-01 15:19:01 +00:00
|
|
|
{
|
2013-03-18 02:01:58 +00:00
|
|
|
if (currentDialogType != UTILITY_DIALOG_OSK)
|
|
|
|
{
|
2013-09-07 19:19:21 +00:00
|
|
|
WARN_LOG(SCEUTILITY, "sceUtilityMsgDialogUpdate(): wrong dialog type");
|
2013-03-18 02:01:58 +00:00
|
|
|
return SCE_ERROR_UTILITY_WRONG_TYPE;
|
|
|
|
}
|
2014-01-31 23:25:41 +00:00
|
|
|
int ret = oskDialog.Update(animSpeed);
|
|
|
|
DEBUG_LOG(SCEUTILITY, "%08x=sceUtilityOskUpdate(%i)",ret,animSpeed);
|
|
|
|
return ret;
|
2012-11-01 15:19:01 +00:00
|
|
|
}
|
|
|
|
|
2012-12-10 12:08:54 +00:00
|
|
|
int sceUtilityOskGetStatus()
|
2012-11-01 15:19:01 +00:00
|
|
|
{
|
2013-03-18 02:01:58 +00:00
|
|
|
if (currentDialogType != UTILITY_DIALOG_OSK)
|
|
|
|
{
|
2013-09-07 19:19:21 +00:00
|
|
|
DEBUG_LOG(SCEUTILITY, "sceUtilityOskGetStatus(): wrong dialog type");
|
2013-03-18 02:01:58 +00:00
|
|
|
return SCE_ERROR_UTILITY_WRONG_TYPE;
|
|
|
|
}
|
|
|
|
|
2012-12-25 14:28:34 +00:00
|
|
|
int status = oskDialog.GetStatus();
|
2013-03-18 02:01:58 +00:00
|
|
|
|
2013-09-07 19:19:21 +00:00
|
|
|
DEBUG_LOG(SCEUTILITY, "%08x=sceUtilityOskGetStatus()", status);
|
2012-12-15 17:13:58 +00:00
|
|
|
return status;
|
2012-11-01 15:19:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-10-13 02:43:49 +00:00
|
|
|
int sceUtilityNetconfInitStart(u32 paramsAddr)
|
2012-11-06 18:22:14 +00:00
|
|
|
{
|
2013-10-13 02:43:49 +00:00
|
|
|
if (currentDialogActive && currentDialogType != UTILITY_DIALOG_NET) {
|
|
|
|
WARN_LOG(SCEUTILITY, "sceUtilityNetconfInitStart(%08x): wrong dialog type", paramsAddr);
|
|
|
|
return SCE_ERROR_UTILITY_WRONG_TYPE;
|
|
|
|
}
|
|
|
|
currentDialogType = UTILITY_DIALOG_NET;
|
|
|
|
currentDialogActive = true;
|
2014-01-31 23:25:41 +00:00
|
|
|
int ret = netDialog.Init(paramsAddr);
|
2014-02-09 00:01:41 +00:00
|
|
|
INFO_LOG(SCEUTILITY, "%08x=sceUtilityNetconfInitStart(%08x)",ret,paramsAddr);
|
2014-01-31 23:25:41 +00:00
|
|
|
return ret;
|
2012-11-06 18:22:14 +00:00
|
|
|
}
|
|
|
|
|
2012-12-25 02:37:28 +00:00
|
|
|
int sceUtilityNetconfShutdownStart(unsigned int unknown)
|
2012-11-06 18:22:14 +00:00
|
|
|
{
|
2013-10-13 02:43:49 +00:00
|
|
|
if (currentDialogType != UTILITY_DIALOG_NET) {
|
2014-02-08 06:29:54 +00:00
|
|
|
WARN_LOG(SCEUTILITY, "sceUtilityNetconfShutdownStart(): wrong dialog type");
|
2013-10-13 02:43:49 +00:00
|
|
|
return SCE_ERROR_UTILITY_WRONG_TYPE;
|
|
|
|
}
|
|
|
|
currentDialogActive = false;
|
2014-01-31 23:25:41 +00:00
|
|
|
int ret = netDialog.Shutdown();
|
|
|
|
DEBUG_LOG(SCEUTILITY, "%08x=sceUtilityNetconfShutdownStart()",ret);
|
|
|
|
return ret;
|
2012-11-06 18:22:14 +00:00
|
|
|
}
|
|
|
|
|
2012-12-25 02:37:28 +00:00
|
|
|
int sceUtilityNetconfUpdate(int animSpeed)
|
2012-11-06 18:22:14 +00:00
|
|
|
{
|
2014-01-31 23:25:41 +00:00
|
|
|
int ret = netDialog.Update(animSpeed);
|
|
|
|
ERROR_LOG(SCEUTILITY, "UNIMPL %08x=sceUtilityNetconfUpdate(%i)",ret,animSpeed);
|
|
|
|
return ret;
|
2012-11-06 18:22:14 +00:00
|
|
|
}
|
|
|
|
|
2012-12-25 02:37:28 +00:00
|
|
|
int sceUtilityNetconfGetStatus()
|
2012-11-06 18:22:14 +00:00
|
|
|
{
|
2013-10-13 02:43:49 +00:00
|
|
|
if (currentDialogType != UTILITY_DIALOG_NET) {
|
|
|
|
WARN_LOG(SCEUTILITY, "sceUtilityNetconfGetStatus(): wrong dialog type");
|
|
|
|
return SCE_ERROR_UTILITY_WRONG_TYPE;
|
|
|
|
}
|
|
|
|
|
|
|
|
int status = netDialog.GetStatus();
|
|
|
|
DEBUG_LOG(SCEUTILITY, "%08x=sceUtilityNetconfGetStatus()", status);
|
|
|
|
return status;
|
2012-11-06 18:22:14 +00:00
|
|
|
}
|
|
|
|
|
2013-06-12 08:46:06 +00:00
|
|
|
//TODO: Implement all sceUtilityScreenshot* for real, it doesn't seem to be complex
|
|
|
|
//but it requires more investigation
|
|
|
|
u32 sceUtilityScreenshotInitStart(u32 unknown1, u32 unknown2, u32 unknown3, u32 unknown4, u32 unknown5, u32 unknown6)
|
|
|
|
{
|
2013-08-31 21:34:36 +00:00
|
|
|
if (currentDialogActive && currentDialogType != UTILITY_DIALOG_SCREENSHOT)
|
|
|
|
{
|
2013-09-07 19:19:21 +00:00
|
|
|
WARN_LOG(SCEUTILITY, "sceUtilityScreenshotInitStart(%x, %x, %x, %x, %x, %x): wrong dialog type", unknown1, unknown2, unknown3, unknown4, unknown5, unknown6);
|
2013-08-31 21:34:36 +00:00
|
|
|
return SCE_ERROR_UTILITY_WRONG_TYPE;
|
|
|
|
}
|
|
|
|
currentDialogType = UTILITY_DIALOG_SCREENSHOT;
|
|
|
|
currentDialogActive = true;
|
|
|
|
|
2013-06-12 09:22:26 +00:00
|
|
|
u32 retval = screenshotDialog.Init();
|
2014-01-31 23:25:41 +00:00
|
|
|
WARN_LOG_REPORT(SCEUTILITY, "UNIMPL %08x=sceUtilityScreenshotInitStart(%x, %x, %x, %x, %x, %x)", retval, unknown1, unknown2, unknown3, unknown4, unknown5, unknown6);
|
2013-06-12 09:22:26 +00:00
|
|
|
return retval;
|
2013-06-12 08:46:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
u32 sceUtilityScreenshotShutdownStart()
|
|
|
|
{
|
2013-08-31 21:34:36 +00:00
|
|
|
if (currentDialogType != UTILITY_DIALOG_SCREENSHOT)
|
|
|
|
{
|
2013-09-07 19:19:21 +00:00
|
|
|
WARN_LOG(SCEUTILITY, "sceUtilityScreenshotShutdownStart(): wrong dialog type");
|
2013-08-31 21:34:36 +00:00
|
|
|
return SCE_ERROR_UTILITY_WRONG_TYPE;
|
|
|
|
}
|
|
|
|
currentDialogActive = false;
|
2014-01-31 23:25:41 +00:00
|
|
|
int ret = screenshotDialog.Shutdown();
|
|
|
|
WARN_LOG(SCEUTILITY, "UNTESTED %08x=sceUtilityScreenshotShutdownStart()",ret);
|
|
|
|
return ret;
|
2013-06-12 08:46:06 +00:00
|
|
|
}
|
|
|
|
|
2013-10-16 16:54:17 +00:00
|
|
|
u32 sceUtilityScreenshotUpdate(u32 animSpeed)
|
2013-06-12 08:46:06 +00:00
|
|
|
{
|
2013-08-31 21:34:36 +00:00
|
|
|
if (currentDialogType != UTILITY_DIALOG_SCREENSHOT)
|
|
|
|
{
|
2013-09-07 19:19:21 +00:00
|
|
|
WARN_LOG(SCEUTILITY, "sceUtilityScreenshotUpdate(): wrong dialog type");
|
2013-08-31 21:34:36 +00:00
|
|
|
return SCE_ERROR_UTILITY_WRONG_TYPE;
|
|
|
|
}
|
2014-01-31 23:25:41 +00:00
|
|
|
int ret = screenshotDialog.Update(animSpeed);
|
2014-03-30 01:29:11 +00:00
|
|
|
WARN_LOG(SCEUTILITY, " %08x=sceUtilityScreenshotUpdate(%d)", ret, animSpeed);
|
2014-02-01 14:45:51 +00:00
|
|
|
return ret;
|
2013-06-12 08:46:06 +00:00
|
|
|
}
|
|
|
|
|
2012-12-08 22:39:47 +00:00
|
|
|
int sceUtilityScreenshotGetStatus()
|
|
|
|
{
|
2013-08-31 21:34:36 +00:00
|
|
|
if (currentDialogType != UTILITY_DIALOG_SCREENSHOT)
|
|
|
|
{
|
2013-09-07 19:19:21 +00:00
|
|
|
DEBUG_LOG(SCEUTILITY, "sceUtilityScreenshotGetStatus(): wrong dialog type");
|
2013-08-31 21:34:36 +00:00
|
|
|
return SCE_ERROR_UTILITY_WRONG_TYPE;
|
|
|
|
}
|
|
|
|
|
2013-06-12 09:20:08 +00:00
|
|
|
u32 retval = screenshotDialog.GetStatus();
|
2014-01-31 23:25:41 +00:00
|
|
|
WARN_LOG(SCEUTILITY, "UNIMPL %08x=sceUtilityScreenshotGetStatus()", retval);
|
2012-12-08 22:39:47 +00:00
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
2013-09-13 15:07:43 +00:00
|
|
|
int sceUtilityGamedataInstallInitStart(u32 paramsAddr)
|
2012-12-19 00:05:45 +00:00
|
|
|
{
|
2013-09-13 15:07:43 +00:00
|
|
|
if (currentDialogActive && currentDialogType != UTILITY_DIALOG_GAMEDATAINSTALL)
|
|
|
|
{
|
2013-09-13 15:57:31 +00:00
|
|
|
WARN_LOG(SCEUTILITY, "sceUtilityGamedataInstallInitStart(%08x): wrong dialog type", paramsAddr);
|
2013-09-13 15:07:43 +00:00
|
|
|
return SCE_ERROR_UTILITY_WRONG_TYPE;
|
|
|
|
}
|
|
|
|
currentDialogType = UTILITY_DIALOG_GAMEDATAINSTALL;
|
2013-09-27 14:52:25 +00:00
|
|
|
currentDialogActive = true;
|
2014-01-31 23:25:41 +00:00
|
|
|
int ret = gamedataInstallDialog.Init(paramsAddr);
|
2014-02-09 00:01:41 +00:00
|
|
|
INFO_LOG(SCEUTILITY, "%08x=sceUtilityGamedataInstallInitStart(%08x)",ret,paramsAddr);
|
2014-01-31 23:25:41 +00:00
|
|
|
return ret;
|
2013-09-13 15:07:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int sceUtilityGamedataInstallShutdownStart() {
|
|
|
|
if (currentDialogType != UTILITY_DIALOG_GAMEDATAINSTALL)
|
|
|
|
{
|
|
|
|
WARN_LOG(SCEUTILITY, "sceUtilityGamedataInstallShutdownStart(): wrong dialog type");
|
|
|
|
return SCE_ERROR_UTILITY_WRONG_TYPE;
|
|
|
|
}
|
|
|
|
currentDialogActive = false;
|
|
|
|
|
|
|
|
DEBUG_LOG(SCEUTILITY, "sceUtilityGamedataInstallShutdownStart()");
|
|
|
|
return gamedataInstallDialog.Shutdown();
|
|
|
|
}
|
|
|
|
|
2013-10-16 16:54:17 +00:00
|
|
|
int sceUtilityGamedataInstallUpdate(int animSpeed) {
|
2013-09-27 14:52:25 +00:00
|
|
|
if (currentDialogType != UTILITY_DIALOG_GAMEDATAINSTALL)
|
|
|
|
{
|
|
|
|
WARN_LOG(SCEUTILITY, "sceUtilityGamedataInstallUpdate(): wrong dialog type");
|
|
|
|
return SCE_ERROR_UTILITY_WRONG_TYPE;
|
|
|
|
}
|
2014-01-31 23:25:41 +00:00
|
|
|
int ret = gamedataInstallDialog.Update(animSpeed);
|
|
|
|
DEBUG_LOG(SCEUTILITY, "%08x=sceUtilityGamedataInstallUpdate(%i)",ret,animSpeed);
|
|
|
|
return ret;
|
2012-12-19 00:05:45 +00:00
|
|
|
}
|
|
|
|
|
2012-12-08 22:39:47 +00:00
|
|
|
int sceUtilityGamedataInstallGetStatus()
|
|
|
|
{
|
2013-09-13 15:07:43 +00:00
|
|
|
if (currentDialogType != UTILITY_DIALOG_GAMEDATAINSTALL)
|
|
|
|
{
|
2013-11-06 09:34:56 +00:00
|
|
|
// This is called incorrectly all the time by some games. So let's not bother warning.
|
|
|
|
// WARN_LOG(SCEUTILITY, "sceUtilityGamedataInstallGetStatus(): wrong dialog type");
|
2013-09-13 15:07:43 +00:00
|
|
|
return SCE_ERROR_UTILITY_WRONG_TYPE;
|
|
|
|
}
|
|
|
|
|
|
|
|
int status = gamedataInstallDialog.GetStatus();
|
|
|
|
DEBUG_LOG(SCEUTILITY, "%08x=sceUtilityGamedataInstallGetStatus()", status);
|
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
|
|
|
int sceUtilityGamedataInstallAbort()
|
|
|
|
{
|
|
|
|
if (currentDialogType != UTILITY_DIALOG_GAMEDATAINSTALL)
|
|
|
|
{
|
|
|
|
WARN_LOG(SCEUTILITY, "sceUtilityMsgDialogShutdownStart(): wrong dialog type");
|
|
|
|
return SCE_ERROR_UTILITY_WRONG_TYPE;
|
|
|
|
}
|
|
|
|
currentDialogActive = false;
|
2014-01-31 23:25:41 +00:00
|
|
|
int ret = gamedataInstallDialog.Abort();
|
|
|
|
DEBUG_LOG(SCEUTILITY, "%08x=sceUtilityGamedataInstallDialogAbort",ret);
|
|
|
|
return ret;
|
2012-12-08 22:39:47 +00:00
|
|
|
}
|
|
|
|
|
2012-12-12 21:08:55 +00:00
|
|
|
//TODO: should save to config file
|
|
|
|
u32 sceUtilitySetSystemParamString(u32 id, u32 strPtr)
|
|
|
|
{
|
2013-09-07 19:19:21 +00:00
|
|
|
WARN_LOG_REPORT(SCEUTILITY, "sceUtilitySetSystemParamString(%i, %08x)", id, strPtr);
|
2012-12-12 21:08:55 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2012-11-14 23:04:40 +00:00
|
|
|
|
2013-04-20 16:30:46 +00:00
|
|
|
u32 sceUtilityGetSystemParamString(u32 id, u32 destaddr, int destSize)
|
2012-11-14 23:04:40 +00:00
|
|
|
{
|
2013-09-07 19:19:21 +00:00
|
|
|
DEBUG_LOG(SCEUTILITY, "sceUtilityGetSystemParamString(%i, %08x, %i)", id, destaddr, destSize);
|
2012-11-14 23:04:40 +00:00
|
|
|
char *buf = (char *)Memory::GetPointer(destaddr);
|
|
|
|
switch (id) {
|
2012-11-22 20:46:22 +00:00
|
|
|
case PSP_SYSTEMPARAM_ID_STRING_NICKNAME:
|
2013-04-20 16:30:46 +00:00
|
|
|
// If there's not enough space for the string and null terminator, fail.
|
|
|
|
if (destSize <= (int)g_Config.sNickName.length())
|
|
|
|
return PSP_SYSTEMPARAM_RETVAL_STRING_TOO_LONG;
|
|
|
|
strncpy(buf, g_Config.sNickName.c_str(), destSize);
|
2012-11-22 20:46:22 +00:00
|
|
|
break;
|
2012-11-14 23:04:40 +00:00
|
|
|
|
2012-11-22 20:46:22 +00:00
|
|
|
default:
|
|
|
|
return PSP_SYSTEMPARAM_RETVAL_FAIL;
|
2012-11-14 23:04:40 +00:00
|
|
|
}
|
2012-11-06 18:22:14 +00:00
|
|
|
|
2012-11-14 23:04:40 +00:00
|
|
|
return 0;
|
2012-11-01 15:19:01 +00:00
|
|
|
}
|
|
|
|
|
2012-11-14 23:04:40 +00:00
|
|
|
u32 sceUtilityGetSystemParamInt(u32 id, u32 destaddr)
|
|
|
|
{
|
2013-09-07 19:19:21 +00:00
|
|
|
DEBUG_LOG(SCEUTILITY,"sceUtilityGetSystemParamInt(%i, %08x)", id,destaddr);
|
2012-11-27 09:18:36 +00:00
|
|
|
u32 param = 0;
|
2012-11-14 23:04:40 +00:00
|
|
|
switch (id) {
|
2012-11-22 20:46:22 +00:00
|
|
|
case PSP_SYSTEMPARAM_ID_INT_ADHOC_CHANNEL:
|
2013-04-19 18:59:24 +00:00
|
|
|
param = g_Config.iWlanAdhocChannel;
|
2012-11-22 20:46:22 +00:00
|
|
|
break;
|
|
|
|
case PSP_SYSTEMPARAM_ID_INT_WLAN_POWERSAVE:
|
2013-04-19 18:59:24 +00:00
|
|
|
param = g_Config.bWlanPowerSave?PSP_SYSTEMPARAM_WLAN_POWERSAVE_ON:PSP_SYSTEMPARAM_WLAN_POWERSAVE_OFF;
|
2012-11-22 20:46:22 +00:00
|
|
|
break;
|
|
|
|
case PSP_SYSTEMPARAM_ID_INT_DATE_FORMAT:
|
2013-04-19 18:59:24 +00:00
|
|
|
param = g_Config.iDateFormat;
|
2012-11-22 20:46:22 +00:00
|
|
|
break;
|
|
|
|
case PSP_SYSTEMPARAM_ID_INT_TIME_FORMAT:
|
2013-06-19 05:08:29 +00:00
|
|
|
param = g_Config.iTimeFormat?PSP_SYSTEMPARAM_TIME_FORMAT_12HR:PSP_SYSTEMPARAM_TIME_FORMAT_24HR;
|
2012-11-22 20:46:22 +00:00
|
|
|
break;
|
|
|
|
case PSP_SYSTEMPARAM_ID_INT_TIMEZONE:
|
2013-04-19 18:59:24 +00:00
|
|
|
param = g_Config.iTimeZone;
|
2012-11-22 20:46:22 +00:00
|
|
|
break;
|
|
|
|
case PSP_SYSTEMPARAM_ID_INT_DAYLIGHTSAVINGS:
|
2013-04-19 18:59:24 +00:00
|
|
|
param = g_Config.bDayLightSavings?PSP_SYSTEMPARAM_DAYLIGHTSAVINGS_SAVING:PSP_SYSTEMPARAM_DAYLIGHTSAVINGS_STD;
|
2012-11-22 20:46:22 +00:00
|
|
|
break;
|
|
|
|
case PSP_SYSTEMPARAM_ID_INT_LANGUAGE:
|
2013-09-16 22:08:09 +00:00
|
|
|
param = g_Config.iLanguage;
|
2012-11-22 20:46:22 +00:00
|
|
|
break;
|
2013-01-20 06:05:01 +00:00
|
|
|
case PSP_SYSTEMPARAM_ID_INT_BUTTON_PREFERENCE:
|
2013-06-21 07:59:35 +00:00
|
|
|
param = g_Config.iButtonPreference;
|
2012-11-22 20:46:22 +00:00
|
|
|
break;
|
2013-02-01 17:06:37 +00:00
|
|
|
case PSP_SYSTEMPARAM_ID_INT_LOCK_PARENTAL_LEVEL:
|
2013-04-20 16:01:03 +00:00
|
|
|
param = g_Config.iLockParentalLevel;
|
2013-02-01 17:06:37 +00:00
|
|
|
break;
|
2012-11-22 20:46:22 +00:00
|
|
|
default:
|
|
|
|
return PSP_SYSTEMPARAM_RETVAL_FAIL;
|
2012-11-14 23:04:40 +00:00
|
|
|
}
|
|
|
|
|
2012-11-27 09:18:36 +00:00
|
|
|
Memory::Write_U32(param, destaddr);
|
|
|
|
|
2012-11-14 23:04:40 +00:00
|
|
|
return 0;
|
2012-11-01 15:19:01 +00:00
|
|
|
}
|
|
|
|
|
2012-11-06 17:56:56 +00:00
|
|
|
u32 sceUtilityLoadNetModule(u32 module)
|
|
|
|
{
|
2013-09-07 19:19:21 +00:00
|
|
|
DEBUG_LOG(SCEUTILITY,"FAKE: sceUtilityLoadNetModule(%i)", module);
|
2012-11-06 17:56:56 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2012-12-12 21:08:55 +00:00
|
|
|
u32 sceUtilityUnloadNetModule(u32 module)
|
|
|
|
{
|
2013-09-07 19:19:21 +00:00
|
|
|
DEBUG_LOG(SCEUTILITY,"FAKE: sceUtilityUnloadNetModule(%i)", module);
|
2012-12-12 21:08:55 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2012-12-19 00:05:45 +00:00
|
|
|
void sceUtilityInstallInitStart(u32 unknown)
|
|
|
|
{
|
2013-09-07 19:19:21 +00:00
|
|
|
WARN_LOG_REPORT(SCEUTILITY, "UNIMPL sceUtilityInstallInitStart()");
|
2012-12-19 00:05:45 +00:00
|
|
|
}
|
|
|
|
|
2013-04-29 03:40:09 +00:00
|
|
|
int sceUtilityStoreCheckoutShutdownStart()
|
|
|
|
{
|
2013-09-07 19:19:21 +00:00
|
|
|
ERROR_LOG(SCEUTILITY,"UNIMPL sceUtilityStoreCheckoutShutdownStart()");
|
2013-04-29 03:40:09 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int sceUtilityStoreCheckoutInitStart(u32 paramsPtr)
|
|
|
|
{
|
2013-09-07 19:19:21 +00:00
|
|
|
ERROR_LOG_REPORT(SCEUTILITY,"UNIMPL sceUtilityStoreCheckoutInitStart(%d)", paramsPtr);
|
2013-04-29 03:40:09 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int sceUtilityStoreCheckoutUpdate(int drawSpeed)
|
|
|
|
{
|
2013-09-07 19:19:21 +00:00
|
|
|
ERROR_LOG(SCEUTILITY,"UNIMPL sceUtilityStoreCheckoutUpdate(%d)", drawSpeed);
|
2013-04-29 03:40:09 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int sceUtilityStoreCheckoutGetStatus()
|
|
|
|
{
|
2013-09-07 19:19:21 +00:00
|
|
|
ERROR_LOG(SCEUTILITY,"UNIMPL sceUtilityStoreCheckoutGetStatus()");
|
2013-04-29 03:40:09 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2013-08-31 21:34:36 +00:00
|
|
|
int sceUtilityGameSharingShutdownStart()
|
|
|
|
{
|
|
|
|
if (currentDialogType != UTILITY_DIALOG_GAMESHARING)
|
|
|
|
{
|
2013-09-07 19:19:21 +00:00
|
|
|
WARN_LOG(SCEUTILITY, "sceUtilityGameSharingShutdownStart(): wrong dialog type");
|
2013-08-31 21:34:36 +00:00
|
|
|
return SCE_ERROR_UTILITY_WRONG_TYPE;
|
|
|
|
}
|
|
|
|
currentDialogActive = false;
|
|
|
|
|
2013-09-07 19:19:21 +00:00
|
|
|
ERROR_LOG(SCEUTILITY, "UNIMPL sceUtilityGameSharingShutdownStart()");
|
2013-08-31 21:34:36 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int sceUtilityGameSharingInitStart(u32 paramsPtr)
|
|
|
|
{
|
|
|
|
if (currentDialogActive && currentDialogType != UTILITY_DIALOG_GAMESHARING)
|
|
|
|
{
|
2013-09-07 19:19:21 +00:00
|
|
|
WARN_LOG(SCEUTILITY, "sceUtilityGameSharingInitStart(%08x)", paramsPtr);
|
2013-08-31 21:34:36 +00:00
|
|
|
return SCE_ERROR_UTILITY_WRONG_TYPE;
|
|
|
|
}
|
|
|
|
currentDialogType = UTILITY_DIALOG_GAMESHARING;
|
|
|
|
currentDialogActive = true;
|
|
|
|
|
2013-09-07 19:19:21 +00:00
|
|
|
ERROR_LOG_REPORT(SCEUTILITY, "UNIMPL sceUtilityGameSharingInitStart(%08x)", paramsPtr);
|
2013-08-31 21:34:36 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int sceUtilityGameSharingUpdate(int drawSpeed)
|
|
|
|
{
|
|
|
|
if (currentDialogType != UTILITY_DIALOG_GAMESHARING)
|
|
|
|
{
|
2013-09-07 19:19:21 +00:00
|
|
|
WARN_LOG(SCEUTILITY, "sceUtilityScreenshotUpdate(): wrong dialog type");
|
2013-08-31 21:34:36 +00:00
|
|
|
return SCE_ERROR_UTILITY_WRONG_TYPE;
|
|
|
|
}
|
|
|
|
|
2013-09-07 19:19:21 +00:00
|
|
|
ERROR_LOG(SCEUTILITY, "UNIMPL sceUtilityGameSharingUpdate(%d)", drawSpeed);
|
2013-08-31 21:34:36 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int sceUtilityGameSharingGetStatus()
|
|
|
|
{
|
|
|
|
if (currentDialogType != UTILITY_DIALOG_GAMESHARING)
|
|
|
|
{
|
2013-09-07 19:19:21 +00:00
|
|
|
DEBUG_LOG(SCEUTILITY, "sceUtilityGameSharingGetStatus(): wrong dialog type");
|
2013-08-31 21:34:36 +00:00
|
|
|
return SCE_ERROR_UTILITY_WRONG_TYPE;
|
|
|
|
}
|
|
|
|
|
2013-09-07 19:19:21 +00:00
|
|
|
ERROR_LOG(SCEUTILITY, "UNIMPL sceUtilityGameSharingGetStatus()");
|
2013-08-31 21:34:36 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2012-11-01 15:19:01 +00:00
|
|
|
const HLEFunction sceUtility[] =
|
|
|
|
{
|
2012-11-06 17:56:56 +00:00
|
|
|
{0x1579a159, &WrapU_U<sceUtilityLoadNetModule>, "sceUtilityLoadNetModule"},
|
2013-03-18 02:01:58 +00:00
|
|
|
{0x64d50c56, &WrapU_U<sceUtilityUnloadNetModule>, "sceUtilityUnloadNetModule"},
|
2012-12-12 21:08:55 +00:00
|
|
|
|
|
|
|
|
2012-12-25 02:37:28 +00:00
|
|
|
{0xf88155f6, &WrapI_U<sceUtilityNetconfShutdownStart>, "sceUtilityNetconfShutdownStart"},
|
|
|
|
{0x4db1e739, &WrapI_U<sceUtilityNetconfInitStart>, "sceUtilityNetconfInitStart"},
|
|
|
|
{0x91e70e35, &WrapI_I<sceUtilityNetconfUpdate>, "sceUtilityNetconfUpdate"},
|
|
|
|
{0x6332aa39, &WrapI_V<sceUtilityNetconfGetStatus>, "sceUtilityNetconfGetStatus"},
|
2013-03-18 02:01:58 +00:00
|
|
|
{0x5eee6548, 0, "sceUtilityCheckNetParam"},
|
|
|
|
{0x434d4b3a, 0, "sceUtilityGetNetParam"},
|
2012-12-12 21:37:58 +00:00
|
|
|
{0x4FED24D8, 0, "sceUtilityGetNetParamLatestID"},
|
2012-11-01 15:19:01 +00:00
|
|
|
|
2013-03-18 02:01:58 +00:00
|
|
|
{0x67af3428, &WrapI_V<sceUtilityMsgDialogShutdownStart>, "sceUtilityMsgDialogShutdownStart"},
|
|
|
|
{0x2ad8e239, &WrapI_U<sceUtilityMsgDialogInitStart>, "sceUtilityMsgDialogInitStart"},
|
|
|
|
{0x95fc253b, &WrapI_I<sceUtilityMsgDialogUpdate>, "sceUtilityMsgDialogUpdate"},
|
|
|
|
{0x9a1c91d7, &WrapI_V<sceUtilityMsgDialogGetStatus>, "sceUtilityMsgDialogGetStatus"},
|
2013-03-31 05:54:00 +00:00
|
|
|
{0x4928bd96, &WrapI_V<sceUtilityMsgDialogAbort>, "sceUtilityMsgDialogAbort"},
|
2012-11-01 15:19:01 +00:00
|
|
|
|
2013-03-18 02:01:58 +00:00
|
|
|
{0x9790b33c, &WrapI_V<sceUtilitySavedataShutdownStart>, "sceUtilitySavedataShutdownStart"},
|
|
|
|
{0x50c4cd57, &WrapI_U<sceUtilitySavedataInitStart>, "sceUtilitySavedataInitStart"},
|
|
|
|
{0xd4b95ffb, &WrapI_I<sceUtilitySavedataUpdate>, "sceUtilitySavedataUpdate"},
|
2012-11-22 20:46:22 +00:00
|
|
|
{0x8874dbe0, &WrapI_V<sceUtilitySavedataGetStatus>, "sceUtilitySavedataGetStatus"},
|
2012-11-01 15:19:01 +00:00
|
|
|
|
2012-12-10 12:08:54 +00:00
|
|
|
{0x3dfaeba9, &WrapI_V<sceUtilityOskShutdownStart>, "sceUtilityOskShutdownStart"},
|
|
|
|
{0xf6269b82, &WrapI_U<sceUtilityOskInitStart>, "sceUtilityOskInitStart"},
|
2013-03-18 02:01:58 +00:00
|
|
|
{0x4b85c861, &WrapI_I<sceUtilityOskUpdate>, "sceUtilityOskUpdate"},
|
2012-12-10 12:08:54 +00:00
|
|
|
{0xf3f76017, &WrapI_V<sceUtilityOskGetStatus>, "sceUtilityOskGetStatus"},
|
2012-11-01 15:19:01 +00:00
|
|
|
|
2012-12-12 21:08:55 +00:00
|
|
|
{0x41e30674, &WrapU_UU<sceUtilitySetSystemParamString>, "sceUtilitySetSystemParamString"},
|
|
|
|
{0x45c18506, 0, "sceUtilitySetSystemParamInt"},
|
2013-04-20 16:30:46 +00:00
|
|
|
{0x34b78343, &WrapU_UUI<sceUtilityGetSystemParamString>, "sceUtilityGetSystemParamString"},
|
2012-11-14 23:04:40 +00:00
|
|
|
{0xA5DA2406, &WrapU_UU<sceUtilityGetSystemParamInt>, "sceUtilityGetSystemParamInt"},
|
2012-12-12 21:08:55 +00:00
|
|
|
|
|
|
|
|
2013-08-31 21:34:36 +00:00
|
|
|
{0xc492f751, &WrapI_U<sceUtilityGameSharingInitStart>, "sceUtilityGameSharingInitStart"},
|
|
|
|
{0xefc6f80f, &WrapI_V<sceUtilityGameSharingShutdownStart>, "sceUtilityGameSharingShutdownStart"},
|
|
|
|
{0x7853182d, &WrapI_I<sceUtilityGameSharingUpdate>, "sceUtilityGameSharingUpdate"},
|
|
|
|
{0x946963f3, &WrapI_V<sceUtilityGameSharingGetStatus>, "sceUtilityGameSharingGetStatus"},
|
2012-12-12 21:08:55 +00:00
|
|
|
|
2013-05-20 02:38:00 +00:00
|
|
|
{0x2995d020, 0, "sceUtilitySavedataErrInitStart"},
|
|
|
|
{0xb62a4061, 0, "sceUtilitySavedataErrShutdownStart"},
|
|
|
|
{0xed0fad38, 0, "sceUtilitySavedataErrUpdate"},
|
|
|
|
{0x88bc7406, 0, "sceUtilitySavedataErrGetStatus"},
|
2012-12-12 21:08:55 +00:00
|
|
|
|
2013-03-18 02:01:58 +00:00
|
|
|
{0xbda7d894, 0, "sceUtilityHtmlViewerGetStatus"},
|
|
|
|
{0xcdc3aa41, 0, "sceUtilityHtmlViewerInitStart"},
|
|
|
|
{0xf5ce1134, 0, "sceUtilityHtmlViewerShutdownStart"},
|
|
|
|
{0x05afb9e4, 0, "sceUtilityHtmlViewerUpdate"},
|
2012-12-12 21:08:55 +00:00
|
|
|
|
2013-08-23 06:04:55 +00:00
|
|
|
{0x16a1a8d8, 0, "sceUtilityAuthDialogGetStatus"},
|
|
|
|
{0x943cba46, 0, "sceUtilityAuthDialogInitStart"},
|
|
|
|
{0x0f3eeaac, 0, "sceUtilityAuthDialogShutdownStart"},
|
|
|
|
{0x147f7c85, 0, "sceUtilityAuthDialogUpdate"},
|
|
|
|
|
2013-03-18 02:01:58 +00:00
|
|
|
{0xc629af26, &WrapU_U<sceUtilityLoadAvModule>, "sceUtilityLoadAvModule"},
|
2012-12-31 12:43:38 +00:00
|
|
|
{0xf7d8d092, &WrapU_U<sceUtilityUnloadAvModule>, "sceUtilityUnloadAvModule"},
|
2012-12-12 21:08:55 +00:00
|
|
|
|
2012-12-31 12:43:38 +00:00
|
|
|
{0x2a2b3de0, &WrapU_U<sceUtilityLoadModule>, "sceUtilityLoadModule"},
|
|
|
|
{0xe49bfe92, &WrapU_U<sceUtilityUnloadModule>, "sceUtilityUnloadModule"},
|
2012-12-12 21:08:55 +00:00
|
|
|
|
2013-06-12 08:46:06 +00:00
|
|
|
{0x0251B134, &WrapU_UUUUUU<sceUtilityScreenshotInitStart>, "sceUtilityScreenshotInitStart"},
|
|
|
|
{0xF9E0008C, &WrapU_V<sceUtilityScreenshotShutdownStart>, "sceUtilityScreenshotShutdownStart"},
|
|
|
|
{0xAB083EA9, &WrapU_U<sceUtilityScreenshotUpdate>, "sceUtilityScreenshotUpdate"},
|
2012-12-08 22:39:47 +00:00
|
|
|
{0xD81957B7, &WrapI_V<sceUtilityScreenshotGetStatus>, "sceUtilityScreenshotGetStatus"},
|
2012-11-06 16:05:51 +00:00
|
|
|
{0x86A03A27, 0, "sceUtilityScreenshotContStart"},
|
2012-11-07 14:44:48 +00:00
|
|
|
|
|
|
|
{0x0D5BC6D2, 0, "sceUtilityLoadUsbModule"},
|
|
|
|
{0xF64910F0, 0, "sceUtilityUnloadUsbModule"},
|
|
|
|
|
2013-09-13 15:07:43 +00:00
|
|
|
{0x24AC31EB, &WrapI_U<sceUtilityGamedataInstallInitStart>, "sceUtilityGamedataInstallInitStart"},
|
|
|
|
{0x32E32DCB, &WrapI_V<sceUtilityGamedataInstallShutdownStart>, "sceUtilityGamedataInstallShutdownStart"},
|
|
|
|
{0x4AECD179, &WrapI_I<sceUtilityGamedataInstallUpdate>, "sceUtilityGamedataInstallUpdate"},
|
2012-12-08 22:39:47 +00:00
|
|
|
{0xB57E95D9, &WrapI_V<sceUtilityGamedataInstallGetStatus>, "sceUtilityGamedataInstallGetStatus"},
|
2013-09-13 15:07:43 +00:00
|
|
|
{0x180F7B62, &WrapI_V<sceUtilityGamedataInstallAbort>, "sceUtilityGamedataInstallAbort"},
|
2012-11-27 10:40:30 +00:00
|
|
|
|
|
|
|
{0x16D02AF0, 0, "sceUtilityNpSigninInitStart"},
|
|
|
|
{0xE19C97D6, 0, "sceUtilityNpSigninShutdownStart"},
|
|
|
|
{0xF3FBC572, 0, "sceUtilityNpSigninUpdate"},
|
|
|
|
{0x86ABDB1B, 0, "sceUtilityNpSigninGetStatus"},
|
2012-12-12 21:08:55 +00:00
|
|
|
|
2012-12-19 00:05:45 +00:00
|
|
|
{0x1281DA8E, &WrapV_U<sceUtilityInstallInitStart>, "sceUtilityInstallInitStart"},
|
2012-12-12 21:08:55 +00:00
|
|
|
{0x5EF1C24A, 0, "sceUtilityInstallShutdownStart"},
|
|
|
|
{0xA03D29BA, 0, "sceUtilityInstallUpdate"},
|
2013-03-18 02:01:58 +00:00
|
|
|
{0xC4700FA3, 0, "sceUtilityInstallGetStatus"},
|
2012-12-12 21:08:55 +00:00
|
|
|
|
2013-04-29 03:40:09 +00:00
|
|
|
{0x54A5C62F, &WrapI_V<sceUtilityStoreCheckoutShutdownStart>, "sceUtilityStoreCheckoutShutdownStart"},
|
|
|
|
{0xDA97F1AA, &WrapI_U<sceUtilityStoreCheckoutInitStart>, "sceUtilityStoreCheckoutInitStart"},
|
|
|
|
{0xB8592D5F, &WrapI_I<sceUtilityStoreCheckoutUpdate>, "sceUtilityStoreCheckoutUpdate"},
|
|
|
|
{0x3AAD51DC, &WrapI_V<sceUtilityStoreCheckoutGetStatus>, "sceUtilityStoreCheckoutGetStatus"},
|
2013-05-20 01:28:05 +00:00
|
|
|
|
2013-05-22 08:19:25 +00:00
|
|
|
{0xd17a0573, 0, "sceUtilityPS3ScanShutdownStart"},
|
|
|
|
{0x42071a83, 0, "sceUtilityPS3ScanInitStart"},
|
|
|
|
{0xd852cdce, 0, "sceUtilityPS3ScanUpdate"},
|
|
|
|
{0x89317c8f, 0, "sceUtilityPS3ScanGetStatus"},
|
|
|
|
|
2013-05-20 01:28:05 +00:00
|
|
|
{0xe1bc175e, 0, "sceUtility_E1BC175E"},
|
|
|
|
{0x43e521b7, 0, "sceUtility_43E521B7"},
|
|
|
|
{0xdb4149ee, 0, "sceUtility_DB4149EE"},
|
|
|
|
{0xcfe7c460, 0, "sceUtility_CFE7C460"},
|
|
|
|
|
2013-12-03 07:36:55 +00:00
|
|
|
{0xc130d441, 0, "sceUtilityPsnShutdownStart"},
|
|
|
|
{0xa7bb7c67, 0, "sceUtilityPsnInitStart"},
|
|
|
|
{0x0940a1b9, 0, "sceUtilityPsnUpdate"},
|
|
|
|
{0x094198b8, 0, "sceUtilityPsnGetStatus"},
|
2013-05-22 08:19:25 +00:00
|
|
|
|
2013-12-03 07:36:55 +00:00
|
|
|
{0x9f313d14, 0, "sceUtilityAutoConnectShutdownStart"},
|
|
|
|
{0x3a15cd0a, 0, "sceUtilityAutoConnectInitStart"},
|
|
|
|
{0xd23665f4, 0, "sceUtilityAutoConnectUpdate"},
|
|
|
|
{0xd4c2bd73, 0, "sceUtilityAutoConnectGetStatus"},
|
|
|
|
{0x0e0c27af, 0, "sceUtilityAutoConnectAbort"},
|
2013-05-22 08:19:25 +00:00
|
|
|
|
2013-06-30 18:40:52 +00:00
|
|
|
{0x06A48659, 0, "sceUtilityRssSubscriberShutdownStart"},
|
|
|
|
{0x4B0A8FE5, 0, "sceUtilityRssSubscriberInitStart"},
|
|
|
|
{0xA084E056, 0, "sceUtilityRssSubscriberUpdate"},
|
|
|
|
{0x2B96173B, 0, "sceUtilityRssSubscriberGetStatus"},
|
|
|
|
|
2013-08-23 06:04:55 +00:00
|
|
|
{0x149a7895, 0, "sceUtilityDNASShutdownStart"},
|
|
|
|
{0xdde5389d, 0, "sceUtilityDNASInitStart"},
|
|
|
|
{0x4a833ba4, 0, "sceUtilityDNASUpdate"},
|
|
|
|
{0xa50e5b30, 0, "sceUtilityDNASGetStatus"},
|
|
|
|
|
|
|
|
{0xe7b778d8, 0, "sceUtilityRssReaderShutdownStart"},
|
|
|
|
{0x81c44706, 0, "sceUtilityRssReaderInitStart"},
|
|
|
|
{0x6f56f9cf, 0, "sceUtilityRssReaderUpdate"},
|
|
|
|
{0x8326ab05, 0, "sceUtilityRssReaderGetStatus"},
|
|
|
|
{0xb0fb7ff5, 0, "sceUtilityRssReaderContStart"},
|
|
|
|
|
|
|
|
{0xbc6b6296, 0, "sceNetplayDialogShutdownStart"},
|
|
|
|
{0x3ad50ae7, 0, "sceNetplayDialogInitStart"},
|
|
|
|
{0x417bed54, 0, "sceNetplayDialogUpdate"},
|
|
|
|
{0xb6cee597, 0, "sceNetplayDialogGetStatus"},
|
|
|
|
|
|
|
|
{0x28d35634, 0, "sceUtility_28D35634"},
|
|
|
|
{0x70267adf, 0, "sceUtility_70267ADF"},
|
|
|
|
{0xece1d3e5, 0, "sceUtility_ECE1D3E5"},
|
|
|
|
{0xef3582b2, 0, "sceUtility_EF3582B2"},
|
2012-11-01 15:19:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
void Register_sceUtility()
|
|
|
|
{
|
|
|
|
RegisterModule("sceUtility", ARRAY_SIZE(sceUtility), sceUtility);
|
|
|
|
}
|