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/.
|
|
|
|
|
|
|
|
#include "HLE.h"
|
|
|
|
#include "../MIPS/MIPS.h"
|
2013-03-09 20:53:53 +00:00
|
|
|
#include "Core/Reporting.h"
|
2012-11-01 15:19:01 +00:00
|
|
|
|
|
|
|
#include "sceKernel.h"
|
|
|
|
#include "sceKernelThread.h"
|
|
|
|
#include "sceUtility.h"
|
|
|
|
|
2012-11-18 12:04:49 +00:00
|
|
|
#include "sceCtrl.h"
|
|
|
|
#include "../Util/PPGeDraw.h"
|
2012-12-10 12:08:54 +00:00
|
|
|
#include "../Dialog/PSPSaveDialog.h"
|
|
|
|
#include "../Dialog/PSPMsgDialog.h"
|
|
|
|
#include "../Dialog/PSPPlaceholderDialog.h"
|
2012-12-15 16:42:38 +00:00
|
|
|
#include "../Dialog/PSPOskDialog.h"
|
2012-11-01 15:19:01 +00:00
|
|
|
|
2013-03-08 06:25:07 +00:00
|
|
|
const int SCE_ERROR_MODULE_BAD_ID = 0x80111101;
|
2013-03-09 20:53:53 +00:00
|
|
|
const int SCE_ERROR_AV_MODULE_BAD_ID = 0x80110F01;
|
2013-03-08 06:25:07 +00:00
|
|
|
|
2012-12-10 12:08:54 +00:00
|
|
|
PSPSaveDialog saveDialog;
|
|
|
|
PSPMsgDialog msgDialog;
|
2012-12-15 16:42:38 +00:00
|
|
|
PSPOskDialog oskDialog;
|
2012-12-10 12:08:54 +00:00
|
|
|
PSPPlaceholderDialog netDialog;
|
2012-11-01 15:19:01 +00:00
|
|
|
|
|
|
|
void __UtilityInit()
|
2012-12-24 09:41:15 +00:00
|
|
|
{
|
|
|
|
SavedataParam::Init();
|
|
|
|
}
|
|
|
|
|
2012-12-28 21:36:37 +00:00
|
|
|
void __UtilityDoState(PointerWrap &p)
|
|
|
|
{
|
|
|
|
saveDialog.DoState(p);
|
|
|
|
msgDialog.DoState(p);
|
|
|
|
oskDialog.DoState(p);
|
|
|
|
netDialog.DoState(p);
|
|
|
|
p.DoMarker("sceUtility");
|
|
|
|
}
|
|
|
|
|
2012-12-24 09:41:15 +00:00
|
|
|
void __UtilityShutdown()
|
2012-11-01 15:19:01 +00:00
|
|
|
{
|
2012-12-24 06:47:52 +00:00
|
|
|
saveDialog.Shutdown();
|
|
|
|
msgDialog.Shutdown();
|
|
|
|
oskDialog.Shutdown();
|
|
|
|
netDialog.Shutdown();
|
2012-11-01 15:19:01 +00:00
|
|
|
}
|
|
|
|
|
2012-11-22 20:46:22 +00:00
|
|
|
int sceUtilitySavedataInitStart(u32 paramAddr)
|
2012-11-01 15:19:01 +00:00
|
|
|
{
|
2012-12-19 20:23:52 +00:00
|
|
|
DEBUG_LOG(HLE,"sceUtilitySavedataInitStart(%08x)", paramAddr);
|
2012-12-25 02:37:28 +00:00
|
|
|
return saveDialog.Init(paramAddr);
|
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
|
|
|
{
|
|
|
|
DEBUG_LOG(HLE,"sceUtilitySavedataShutdownStart()");
|
2012-12-25 02:37:28 +00:00
|
|
|
return saveDialog.Shutdown();
|
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 00:49:37 +00:00
|
|
|
int status = saveDialog.GetStatus();
|
|
|
|
DEBUG_LOG(HLE,"%08x=sceUtilitySavedataGetStatus()", status);
|
|
|
|
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
|
|
|
{
|
2012-12-25 02:37:28 +00:00
|
|
|
DEBUG_LOG(HLE,"sceUtilitySavedataUpdate(%d)", animSpeed);
|
2013-03-18 00:49:37 +00:00
|
|
|
return hleDelayResult(saveDialog.Update(), "savedata update", 300);
|
2012-11-01 15:19:01 +00:00
|
|
|
}
|
2012-11-22 20:46:22 +00:00
|
|
|
|
2013-01-20 06:05:01 +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)
|
|
|
|
{
|
|
|
|
ERROR_LOG(HLE, "sceUtilityLoadAvModule(%i): invalid module id", module);
|
|
|
|
Reporting::ReportMessage("sceUtilityLoadAvModule(%i): invalid module id", module);
|
|
|
|
return SCE_ERROR_AV_MODULE_BAD_ID;
|
|
|
|
}
|
|
|
|
|
2012-11-22 20:46:22 +00:00
|
|
|
DEBUG_LOG(HLE,"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)
|
|
|
|
{
|
|
|
|
DEBUG_LOG(HLE,"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)
|
|
|
|
{
|
|
|
|
ERROR_LOG(HLE, "sceUtilityLoadModule(%i): invalid module id", module);
|
2013-03-09 20:53:53 +00:00
|
|
|
Reporting::ReportMessage("sceUtilityLoadModule(%i): invalid module id", module);
|
2013-03-08 06:25:07 +00:00
|
|
|
return SCE_ERROR_MODULE_BAD_ID;
|
|
|
|
}
|
|
|
|
|
|
|
|
DEBUG_LOG(HLE, "sceUtilityLoadModule(%i)", module);
|
|
|
|
// TODO: Each module has its own timing, technically, but this is a low-end.
|
|
|
|
// Note: Some modules have dependencies, but they still resched.
|
|
|
|
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)
|
|
|
|
{
|
|
|
|
ERROR_LOG(HLE, "sceUtilityUnloadModule(%i): invalid module id", module);
|
2013-03-09 20:53:53 +00:00
|
|
|
Reporting::ReportMessage("sceUtilityUnloadModule(%i): invalid module id", module);
|
2013-03-08 06:25:07 +00:00
|
|
|
return SCE_ERROR_MODULE_BAD_ID;
|
|
|
|
}
|
|
|
|
|
|
|
|
DEBUG_LOG(HLE, "sceUtilityUnloadModule(%i)", module);
|
|
|
|
// 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
|
|
|
{
|
2012-11-18 22:14:50 +00:00
|
|
|
DEBUG_LOG(HLE,"sceUtilityMsgDialogInitStart(%i)", structAddr);
|
2012-12-25 02:37:28 +00:00
|
|
|
return msgDialog.Init(structAddr);
|
2012-11-01 15:19:01 +00:00
|
|
|
}
|
|
|
|
|
2012-12-25 02:37:28 +00:00
|
|
|
int sceUtilityMsgDialogShutdownStart(u32 unknown)
|
2012-11-01 15:19:01 +00:00
|
|
|
{
|
2012-12-25 14:28:34 +00:00
|
|
|
DEBUG_LOG(HLE,"sceUtilityMsgDialogShutdownStart(%i)", unknown);
|
2012-12-25 02:37:28 +00:00
|
|
|
return msgDialog.Shutdown();
|
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
|
|
|
{
|
2012-11-18 23:29:41 +00:00
|
|
|
DEBUG_LOG(HLE,"sceUtilityMsgDialogUpdate(%i)", animSpeed);
|
2012-12-25 02:37:28 +00:00
|
|
|
return msgDialog.Update();
|
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
|
|
|
{
|
2012-12-25 02:37:28 +00:00
|
|
|
DEBUG_LOG(HLE,"sceUtilityMsgDialogGetStatus()");
|
2012-12-10 12:08:54 +00:00
|
|
|
return msgDialog.GetStatus();
|
2012-11-01 15:19:01 +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
|
|
|
{
|
2012-12-25 14:28:34 +00:00
|
|
|
DEBUG_LOG(HLE,"sceUtilityOskInitStart(%i)", PARAM(0));
|
2012-12-15 16:42:38 +00:00
|
|
|
return oskDialog.Init(oskPtr);
|
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
|
|
|
{
|
2012-12-25 14:28:34 +00:00
|
|
|
DEBUG_LOG(HLE,"sceUtilityOskShutdownStart(%i)", PARAM(0));
|
2012-12-25 02:37:28 +00:00
|
|
|
return oskDialog.Shutdown();
|
2012-11-01 15:19:01 +00:00
|
|
|
}
|
|
|
|
|
2012-12-25 02:37:28 +00:00
|
|
|
int sceUtilityOskUpdate(unsigned int unknown)
|
2012-11-01 15:19:01 +00:00
|
|
|
{
|
2012-12-25 14:28:34 +00:00
|
|
|
DEBUG_LOG(HLE,"FAKE sceUtilityOskUpdate(%i)", unknown);
|
2012-12-25 02:37:28 +00:00
|
|
|
return oskDialog.Update();
|
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
|
|
|
{
|
2012-12-25 14:28:34 +00:00
|
|
|
int status = oskDialog.GetStatus();
|
2012-12-15 17:13:58 +00:00
|
|
|
// Seems that 4 is the cancelled status for OSK?
|
|
|
|
if (status == 4)
|
2012-12-15 16:42:38 +00:00
|
|
|
{
|
2012-12-15 17:13:58 +00:00
|
|
|
status = 5;
|
2012-12-15 16:42:38 +00:00
|
|
|
}
|
2012-12-15 17:13:58 +00:00
|
|
|
return status;
|
2012-11-01 15:19:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-12-25 02:37:28 +00:00
|
|
|
int sceUtilityNetconfInitStart(u32 structAddr)
|
2012-11-06 18:22:14 +00:00
|
|
|
{
|
2012-12-25 02:37:28 +00:00
|
|
|
DEBUG_LOG(HLE,"FAKE sceUtilityNetconfInitStart(%08x)", structAddr);
|
|
|
|
return netDialog.Init();
|
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
|
|
|
{
|
2012-12-10 12:08:54 +00:00
|
|
|
DEBUG_LOG(HLE,"FAKE sceUtilityNetconfShutdownStart(%i)", unknown);
|
2012-12-25 02:37:28 +00:00
|
|
|
return netDialog.Shutdown();
|
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
|
|
|
{
|
2012-12-25 02:37:28 +00:00
|
|
|
DEBUG_LOG(HLE,"FAKE sceUtilityNetconfUpdate(%i)", animSpeed);
|
|
|
|
return netDialog.Update();
|
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
|
|
|
{
|
|
|
|
DEBUG_LOG(HLE,"sceUtilityNetconfGetStatus()");
|
2012-12-10 12:08:54 +00:00
|
|
|
return netDialog.GetStatus();
|
2012-11-06 18:22:14 +00:00
|
|
|
}
|
|
|
|
|
2012-12-08 22:39:47 +00:00
|
|
|
int sceUtilityScreenshotGetStatus()
|
|
|
|
{
|
|
|
|
u32 retval = 0;//__UtilityGetStatus();
|
|
|
|
DEBUG_LOG(HLE,"%i=sceUtilityScreenshotGetStatus()", retval);
|
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
2012-12-19 00:05:45 +00:00
|
|
|
void sceUtilityGamedataInstallInitStart(u32 unkown)
|
|
|
|
{
|
2012-12-25 14:28:34 +00:00
|
|
|
DEBUG_LOG(HLE,"UNIMPL sceUtilityGamedataInstallInitStart(%i)", unkown);
|
2012-12-19 00:05:45 +00:00
|
|
|
}
|
|
|
|
|
2012-12-08 22:39:47 +00:00
|
|
|
int sceUtilityGamedataInstallGetStatus()
|
|
|
|
{
|
|
|
|
u32 retval = 0;//__UtilityGetStatus();
|
2012-12-25 14:28:34 +00:00
|
|
|
DEBUG_LOG(HLE,"UNIMPL %i=sceUtilityGamedataInstallGetStatus()", retval);
|
2012-12-08 22:39:47 +00:00
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
2013-01-20 06:05:01 +00:00
|
|
|
#define PSP_SYSTEMPARAM_ID_STRING_NICKNAME 1
|
|
|
|
#define PSP_SYSTEMPARAM_ID_INT_ADHOC_CHANNEL 2
|
|
|
|
#define PSP_SYSTEMPARAM_ID_INT_WLAN_POWERSAVE 3
|
|
|
|
#define PSP_SYSTEMPARAM_ID_INT_DATE_FORMAT 4
|
|
|
|
#define PSP_SYSTEMPARAM_ID_INT_TIME_FORMAT 5
|
2012-11-14 23:04:40 +00:00
|
|
|
//Timezone offset from UTC in minutes, (EST = -300 = -5 * 60)
|
2013-01-20 06:05:01 +00:00
|
|
|
#define PSP_SYSTEMPARAM_ID_INT_TIMEZONE 6
|
|
|
|
#define PSP_SYSTEMPARAM_ID_INT_DAYLIGHTSAVINGS 7
|
|
|
|
#define PSP_SYSTEMPARAM_ID_INT_LANGUAGE 8
|
|
|
|
#define PSP_SYSTEMPARAM_ID_INT_BUTTON_PREFERENCE 9
|
2013-02-01 17:06:37 +00:00
|
|
|
#define PSP_SYSTEMPARAM_ID_INT_LOCK_PARENTAL_LEVEL 10
|
2012-11-14 23:04:40 +00:00
|
|
|
|
|
|
|
/**
|
2012-11-22 20:46:22 +00:00
|
|
|
* Return values for the SystemParam functions
|
|
|
|
*/
|
2012-11-14 23:04:40 +00:00
|
|
|
#define PSP_SYSTEMPARAM_RETVAL_OK 0
|
|
|
|
#define PSP_SYSTEMPARAM_RETVAL_FAIL 0x80110103
|
|
|
|
|
2013-01-20 06:05:01 +00:00
|
|
|
|
2012-11-14 23:04:40 +00:00
|
|
|
/**
|
2012-11-22 20:46:22 +00:00
|
|
|
* Valid values for PSP_SYSTEMPARAM_ID_INT_ADHOC_CHANNEL
|
|
|
|
*/
|
2013-01-20 06:05:01 +00:00
|
|
|
#define PSP_SYSTEMPARAM_ADHOC_CHANNEL_AUTOMATIC 0
|
|
|
|
#define PSP_SYSTEMPARAM_ADHOC_CHANNEL_1 1
|
|
|
|
#define PSP_SYSTEMPARAM_ADHOC_CHANNEL_6 6
|
|
|
|
#define PSP_SYSTEMPARAM_ADHOC_CHANNEL_11 11
|
2012-11-14 23:04:40 +00:00
|
|
|
|
|
|
|
/**
|
2012-11-22 20:46:22 +00:00
|
|
|
* Valid values for PSP_SYSTEMPARAM_ID_INT_WLAN_POWERSAVE
|
|
|
|
*/
|
2012-11-14 23:04:40 +00:00
|
|
|
#define PSP_SYSTEMPARAM_WLAN_POWERSAVE_OFF 0
|
|
|
|
#define PSP_SYSTEMPARAM_WLAN_POWERSAVE_ON 1
|
|
|
|
|
|
|
|
/**
|
2012-11-22 20:46:22 +00:00
|
|
|
* Valid values for PSP_SYSTEMPARAM_ID_INT_DATE_FORMAT
|
|
|
|
*/
|
2012-11-14 23:04:40 +00:00
|
|
|
#define PSP_SYSTEMPARAM_DATE_FORMAT_YYYYMMDD 0
|
|
|
|
#define PSP_SYSTEMPARAM_DATE_FORMAT_MMDDYYYY 1
|
|
|
|
#define PSP_SYSTEMPARAM_DATE_FORMAT_DDMMYYYY 2
|
|
|
|
|
|
|
|
/**
|
2012-11-22 20:46:22 +00:00
|
|
|
* Valid values for PSP_SYSTEMPARAM_ID_INT_DAYLIGHTSAVINGS
|
|
|
|
*/
|
2012-11-14 23:04:40 +00:00
|
|
|
#define PSP_SYSTEMPARAM_DAYLIGHTSAVINGS_STD 0
|
|
|
|
#define PSP_SYSTEMPARAM_DAYLIGHTSAVINGS_SAVING 1
|
|
|
|
|
2013-01-20 06:05:01 +00:00
|
|
|
/**
|
|
|
|
* Valid values for PSP_SYSTEMPARAM_ID_INT_BUTTON_PREFERENCE
|
|
|
|
*/
|
|
|
|
#define PSP_SYSTEMPARAM_BUTTON_CIRCLE 0
|
|
|
|
#define PSP_SYSTEMPARAM_BUTTON_CROSS 1
|
|
|
|
|
2012-12-12 21:08:55 +00:00
|
|
|
//TODO: should save to config file
|
|
|
|
u32 sceUtilitySetSystemParamString(u32 id, u32 strPtr)
|
|
|
|
{
|
|
|
|
DEBUG_LOG(HLE,"sceUtilitySetSystemParamString(%i, %08x)", id,strPtr);
|
|
|
|
return 0;
|
|
|
|
}
|
2012-11-14 23:04:40 +00:00
|
|
|
|
2012-12-12 21:08:55 +00:00
|
|
|
//TODO: Should load from config file
|
2012-11-14 23:04:40 +00:00
|
|
|
u32 sceUtilityGetSystemParamString(u32 id, u32 destaddr, u32 unknownparam)
|
|
|
|
{
|
2012-12-12 21:08:55 +00:00
|
|
|
DEBUG_LOG(HLE,"sceUtilityGetSystemParamString(%i, %08x, %i)", id,destaddr,unknownparam);
|
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:
|
|
|
|
strcpy(buf, "shadow");
|
|
|
|
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-12-12 21:08:55 +00:00
|
|
|
//TODO: Should load from config file
|
2012-11-14 23:04:40 +00:00
|
|
|
u32 sceUtilityGetSystemParamInt(u32 id, u32 destaddr)
|
|
|
|
{
|
|
|
|
DEBUG_LOG(HLE,"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:
|
2012-11-27 09:18:36 +00:00
|
|
|
param = PSP_SYSTEMPARAM_ADHOC_CHANNEL_AUTOMATIC;
|
2012-11-22 20:46:22 +00:00
|
|
|
break;
|
|
|
|
case PSP_SYSTEMPARAM_ID_INT_WLAN_POWERSAVE:
|
2012-11-27 09:18:36 +00:00
|
|
|
param = PSP_SYSTEMPARAM_WLAN_POWERSAVE_OFF;
|
2012-11-22 20:46:22 +00:00
|
|
|
break;
|
|
|
|
case PSP_SYSTEMPARAM_ID_INT_DATE_FORMAT:
|
2012-11-27 09:18:36 +00:00
|
|
|
param = PSP_SYSTEMPARAM_DATE_FORMAT_DDMMYYYY;
|
2012-11-22 20:46:22 +00:00
|
|
|
break;
|
|
|
|
case PSP_SYSTEMPARAM_ID_INT_TIME_FORMAT:
|
2013-01-21 13:35:31 +00:00
|
|
|
param = g_Config.itimeformat;
|
2012-11-22 20:46:22 +00:00
|
|
|
break;
|
|
|
|
case PSP_SYSTEMPARAM_ID_INT_TIMEZONE:
|
2012-11-27 09:18:36 +00:00
|
|
|
param = 60;
|
2012-11-22 20:46:22 +00:00
|
|
|
break;
|
|
|
|
case PSP_SYSTEMPARAM_ID_INT_DAYLIGHTSAVINGS:
|
2012-11-27 09:18:36 +00:00
|
|
|
param = PSP_SYSTEMPARAM_TIME_FORMAT_24HR;
|
2012-11-22 20:46:22 +00:00
|
|
|
break;
|
|
|
|
case PSP_SYSTEMPARAM_ID_INT_LANGUAGE:
|
2013-01-20 09:50:05 +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:
|
|
|
|
param = PSP_SYSTEMPARAM_BUTTON_CROSS;
|
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:
|
|
|
|
param = 0;
|
|
|
|
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)
|
|
|
|
{
|
|
|
|
DEBUG_LOG(HLE,"FAKE: sceUtilityLoadNetModule(%i)", module);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2012-12-12 21:08:55 +00:00
|
|
|
u32 sceUtilityUnloadNetModule(u32 module)
|
|
|
|
{
|
|
|
|
DEBUG_LOG(HLE,"FAKE: sceUtilityUnloadNetModule(%i)", module);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2012-12-19 00:05:45 +00:00
|
|
|
void sceUtilityInstallInitStart(u32 unknown)
|
|
|
|
{
|
|
|
|
DEBUG_LOG(HLE,"FAKE sceUtilityInstallInitStart()");
|
|
|
|
}
|
|
|
|
|
2012-11-01 15:19:01 +00:00
|
|
|
const HLEFunction sceUtility[] =
|
|
|
|
{
|
2012-11-06 17:56:56 +00:00
|
|
|
{0x1579a159, &WrapU_U<sceUtilityLoadNetModule>, "sceUtilityLoadNetModule"},
|
2012-12-12 21:08:55 +00:00
|
|
|
{0x64d50c56, &WrapU_U<sceUtilityUnloadNetModule>, "sceUtilityUnloadNetModule"},
|
|
|
|
|
|
|
|
|
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"},
|
2012-12-12 21:08:55 +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
|
|
|
|
2012-12-25 02:37:28 +00:00
|
|
|
{0x67af3428, &WrapI_U<sceUtilityMsgDialogShutdownStart>, "sceUtilityMsgDialogShutdownStart"},
|
|
|
|
{0x2ad8e239, &WrapI_U<sceUtilityMsgDialogInitStart>, "sceUtilityMsgDialogInitStart"},
|
|
|
|
{0x95fc253b, &WrapI_I<sceUtilityMsgDialogUpdate>, "sceUtilityMsgDialogUpdate"},
|
|
|
|
{0x9a1c91d7, &WrapI_V<sceUtilityMsgDialogGetStatus>, "sceUtilityMsgDialogGetStatus"},
|
2012-12-12 21:08:55 +00:00
|
|
|
{0x4928bd96, 0, "sceUtilityMsgDialogAbort"},
|
2012-11-01 15:19:01 +00:00
|
|
|
|
2012-11-22 20:46:22 +00:00
|
|
|
{0x9790b33c, &WrapI_V<sceUtilitySavedataShutdownStart>, "sceUtilitySavedataShutdownStart"},
|
|
|
|
{0x50c4cd57, &WrapI_U<sceUtilitySavedataInitStart>, "sceUtilitySavedataInitStart"},
|
2012-12-25 02:37:28 +00:00
|
|
|
{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"},
|
2012-12-25 02:37:28 +00:00
|
|
|
{0x4b85c861, &WrapI_U<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"},
|
2012-11-14 23:04:40 +00:00
|
|
|
{0x34b78343, &WrapU_UUU<sceUtilityGetSystemParamString>, "sceUtilityGetSystemParamString"},
|
|
|
|
{0xA5DA2406, &WrapU_UU<sceUtilityGetSystemParamInt>, "sceUtilityGetSystemParamInt"},
|
2012-12-12 21:08:55 +00:00
|
|
|
|
|
|
|
|
2012-11-01 15:19:01 +00:00
|
|
|
{0xc492f751, 0, "sceUtilityGameSharingInitStart"},
|
|
|
|
{0xefc6f80f, 0, "sceUtilityGameSharingShutdownStart"},
|
|
|
|
{0x7853182d, 0, "sceUtilityGameSharingUpdate"},
|
|
|
|
{0x946963f3, 0, "sceUtilityGameSharingGetStatus"},
|
2012-12-12 21:08:55 +00:00
|
|
|
|
2012-11-01 15:19:01 +00:00
|
|
|
{0x2995d020, 0, "sceUtility_2995d020"},
|
|
|
|
{0xb62a4061, 0, "sceUtility_b62a4061"},
|
|
|
|
{0xed0fad38, 0, "sceUtility_ed0fad38"},
|
|
|
|
{0x88bc7406, 0, "sceUtility_88bc7406"},
|
2012-12-12 21:08:55 +00:00
|
|
|
|
2012-11-01 15:19:01 +00:00
|
|
|
{0xbda7d894, 0, "sceUtilityHtmlViewerGetStatus"},
|
|
|
|
{0xcdc3aa41, 0, "sceUtilityHtmlViewerInitStart"},
|
|
|
|
{0xf5ce1134, 0, "sceUtilityHtmlViewerShutdownStart"},
|
|
|
|
{0x05afb9e4, 0, "sceUtilityHtmlViewerUpdate"},
|
2012-12-12 21:08:55 +00:00
|
|
|
|
2012-12-31 12:43:38 +00:00
|
|
|
{0xc629af26, &WrapU_U<sceUtilityLoadAvModule>, "sceUtilityLoadAvModule"},
|
|
|
|
{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
|
|
|
|
2012-11-06 16:05:51 +00:00
|
|
|
{0x0251B134, 0, "sceUtilityScreenshotInitStart"},
|
|
|
|
{0xF9E0008C, 0, "sceUtilityScreenshotShutdownStart"},
|
|
|
|
{0xAB083EA9, 0, "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"},
|
|
|
|
|
2012-12-19 00:05:45 +00:00
|
|
|
{0x24AC31EB, &WrapV_U<sceUtilityGamedataInstallInitStart>, "sceUtilityGamedataInstallInitStart"},
|
2012-11-22 20:46:22 +00:00
|
|
|
{0x32E32DCB, 0, "sceUtilityGamedataInstallShutdownStart"},
|
|
|
|
{0x4AECD179, 0, "sceUtilityGamedataInstallUpdate"},
|
2012-12-08 22:39:47 +00:00
|
|
|
{0xB57E95D9, &WrapI_V<sceUtilityGamedataInstallGetStatus>, "sceUtilityGamedataInstallGetStatus"},
|
2012-11-15 09:15:40 +00:00
|
|
|
{0x180F7B62, 0, "sceUtilityGamedataInstallAbortFunction"},
|
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"},
|
|
|
|
{0xC4700FA3, 0, "sceUtilityInstallGetStatus"},
|
|
|
|
|
2012-11-01 15:19:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
void Register_sceUtility()
|
|
|
|
{
|
|
|
|
RegisterModule("sceUtility", ARRAY_SIZE(sceUtility), sceUtility);
|
|
|
|
}
|