SceShellSvc

From Vita Development Wiki
Revision as of 21:31, 1 May 2023 by Princess of Sleeping (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Module

Version World Privilege
1.69-3.60 Non-secure User

Libraries

Known NIDs

Version Name World Visibility NID
3.60 SceShellSvc Non-secure User 0x773242C7
3.60 SceShellUtil Non-secure User 0xD2B1C8AE
3.60 SceShellUtilUketorne Non-secure User 0xA2316143
3.60 SceShellUtilLaunchApp Non-secure User 0xA0FD0261
3.60 SceSvcCtrl Non-secure User 0x33E9B101
3.60 SceIpmi Non-secure User 0xF4E34EDB

Types

#define SCE_SHELL_UTIL_LOCK_TYPE_ICON_FOCUS 0x10

#define SCE_SHELL_SVC_ERROR_ALREADY_REGISTERED 0x80100901
#define SCE_SHELL_SVC_ERROR_INVALID_CALLBACK_ID 0x80100910
#define SCE_SHELL_SVC_ERROR_INVALID_EVENT_FLAG_ID 0x80100970

typedef struct SceShellSvcCustomAudioSubParams1 {
	int unk_00; // not used (set to 0)
	int tracking1;
	int tracking2;
} SceShellSvcCustomAudioSubParams1;

typedef struct SceShellSvcCustomAudioSubParams2 {
	int flag;
	int unk_04;
	int unk_08;
	int unk_0C;
} SceShellSvcCustomAudioSubParams2;

typedef struct SceShellSvcCustomAudioSubParams3 {
	int param1;
	int param2;
} SceShellSvcCustomAudioSubParams3;

typedef struct SceShellSvcCustomAudioParams {
	void* params1;  	// optional params1
	SceSize params1Size; 	// size of optional params1
	void* params2; 		// optional params2
	SceSize params2Size;	// size of optional params2
	void* params3;		// optional params3
	SceSize params3Size;	// size of optional params3
	void* params4;		// optional params4
	SceSize params4Size;	// size of optional params4
} SceShellSvcAudioCustomParams;

// Actual name seems to be IPMI::Client (C++ only)
typedef struct SceShellSvcTable {
	void *pFunc_0x00;
	void *pFunc_0x04;
	void *pFunc_0x08;
	void *pFunc_0x0C;
	void *pFunc_0x10;
	int(*sceShellSvcAudioControl)(void *obj, int flag, SceShellSvcAudioCustomParams*, int numOfArg, int *pRes,SceShellSvcAudioCustomParams*, int numOfOut);
	void *pFunc_0x18;
	int(*sceShellSvcAsyncMethod)(void *obj, int asyncMethodId, .../* more args here */);
	// more ...
} SceShellSvcTable;

SceShellSvc

sceShellSvcInitialize

Version NID
3.60 0xE91AEAD4

This is a guessed name.

SceInt32 sceShellSvcInitialize();

sceShellSvcRegisterCallback

Version NID
3.60 0xD943CE15

This is a guessed name.

SceInt32 sceShellSvcRegisterCallback(SceUInt32 callbackId, SceInt32 (*pCallback)(SceUInt32 cbSlotId, ScePVoid userData), ScePVoid userData);

sceShellSvcPeekClearEventFlag

Version NID
3.60 0xBD4161B0

This is a guessed name.

Same as #sceShellSvcClearEventFlag, but returns 1 in *pWasCancelled if the flag was set, 0 if not.

SceInt32 sceShellSvcPeekClearEventFlag(SceUInt32 flagId, bool* pWasCancelled);

sceShellSvcGetEventFlagSmth

Version NID
3.60 0xA0B067AC

This is a guessed name.

/*
  Returns what you need to pollEventFlag/waitEventFlag
  info[0] = ?eventFlagIdx?
  info[1] = bitPattern
*/
SceInt32 sceShellSvcGetEventFlagSmth(SceUInt32 info[2], SceInt32 flagId);

sceShellSvcWaitEventFlag

Version NID
3.60 0x8D4F9F2E

This is a guessed name.

SceInt32 sceShellSvcWaitEventFlag(SceUInt32 flagId);

sceShellSvcUnregisterCallback

Version NID
3.60 0x7CBF442B

This is a guessed name.

SceInt32 sceShellSvcUnregisterCallback(SceUInt32 callbackId);

sceShellSvcCheckCallback

Version NID
3.60 0xFB03FBC9
SceInt32 sceShellSvcCheckCallback(SceUInt32 callbackId);

sceShellSvcClearEventFlag

Version NID
3.60 0xB452A177
SceInt32 sceShellSvcClearEventFlag(SceInt32 flagId);

sceShellSvcCancelCallback

Version NID
3.60 0x1FAB9A1E
SceInt32 sceShellSvcCancelCallback(SceInt32 callbackId);

sceShellSvcGetSvcObj

Version NID
3.60 0xB31E7F1C

This is a guessed name. Temp name was sceShellSvcGetTable.

IPMI::Client* sceShellSvcGetSvcObj(void);

SceShellUtil

3.60:
SceShellUtil_01141995
SceShellUtil_03201F4B
SceShellUtil_0B066FAD
SceShellUtil_0E7EAD89
SceShellUtil_29DB95D1
SceShellUtil_3219A1C0
SceShellUtil_48C7E8F8
SceShellUtil_4A234ABB
SceShellUtil_5C5373B9
SceShellUtil_6430C45E
SceShellUtil_6F730976
SceShellUtil_71C21A8C
SceShellUtil_7A2CC043
SceShellUtil_8CAAB23B
SceShellUtil_9A83AC60
SceShellUtil_9B0EE918
SceShellUtil_B67A0C68
SceShellUtil_CE35B2B8
SceShellUtil_D71D8245
SceShellUtil_E701BA71
SceShellUtil_EC5881A5
SceShellUtil_F75C684D
SceShellUtil_F979148A
SceShellUtil_FB612CA8
SceShellUtil_FD521712

sceShellUtilSetSystemLanguage

Version NID
3.60 0x040997D6

It takes about 5 seconds to apply.

int sceShellUtilSetSystemLanguage(int languageId);

sceShellUtilSetBGMMode

Version NID
3.60 0xB65B60CA
// 0 to disable, 1 to enable BackGround Music
int sceShellUtilSetBGMMode(int mode);

sceShellUtilSetBtIconMode

Version NID
3.60 0x8B69AD27
// 0 to hide, 1 to show BlueTooth icon
int sceShellUtilSetBtIconMode(int mode);

sceShellUtilSetAirplaneIconMode

Version NID
3.60 0x96BBF91B
// 0 to hide, 1 to show airplane icon
int sceShellUtilSetAirplaneIconMode(int mode);

sceShellUtilSetTimeText

Version NID
3.60 0x40DFAC6B

Sets text in time display, UTF-16 (remains until reboot?).

sceShellUtilSetTimeText(char* a1, char* text);

sceShellUtilShutdown

Version NID
3.60 0x8F2F143D

Another possible name is sceShellUtilRequestPowerOff.

int sceShellUtilShutdown(int a1);

sceShellUtilReboot

Version NID
3.60 0x636544FB

Another possible name is sceShellUtilRequestReboot.

int sceShellUtilReboot(int a1);

sceShellUtilRequestRebootWithError

Version NID
3.60 0xBB54D049

It shows "A serious error has occured" message before rebooting.

/*
  safeModeType - sets type of safemode to reboot into, 0 to reboot normally
  errorCode - error code to display in the message
  errorMessageType - ex. 0 "Contact technical support"
*/

int sceShellUtilRequestRebootWithError(int safeModeType, int errorCode, int errorMessageType);

sceShellUtilTextClipboardGetUsedSize

Version NID
3.60 0xD0DDEDBC

This function returns size of the data that was written to clipboard with #sceShellUtilTextClipboardWrite.

unsigned int sceShellUtilTextClipboardGetUsedSize(void);

sceShellUtilTextClipboardWrite

Version NID
3.60 0xC4810C56
/*
  data - pointer to the data to write
  size - size of data to write. Must not exceed 0x1FFD.
*/

=== sceShellUtilTextClipboardRead ===
{| class="wikitable"
! Version !! NID
|-
| 3.60 || 0x1B186905
|}

<source lang="C">
/*
  data - pointer to the buffer where the read data will be placed
  size - size of data to read
  [out] textlen - length actually read
*/

int sceShellUtilTextClipboardRead(void* data, SceSize size, SceSize *textlen);

int sceShellUtilTextClipboardWrite(const void* data, SceSize size); </source>

sceShellUtilInitEvents

Version NID
3.60 0xE8AD11EC

sceShellUtilSetCallback

Version NID
3.60 0x7B5EDFE7

sceShellUtilLock

Version NID
3.60 0xA9537233

sceShellUtilUnlock

Version NID
3.60 0x21A6CF54

SceShellUtilUketorne

3.60:
SceShellUtilUketorne_0C73C5E0
SceShellUtilUketorne_154D9067
SceShellUtilUketorne_156FEACF
SceShellUtilUketorne_A4C2ACFC
SceShellUtilUketorne_B98FC611
SceShellUtilUketorne_FB551721
SceShellUtilUketorne_FDC48BBE

SceShellUtilLaunchApp

sceShellUtilLaunchApp

Version NID
3.60 0x5372EEDB

This is a guessed name.

int sceShellUtilLaunchApp(void *some_struct);

SceSvcCtrl

3.60:
SceSvcCtrl_077F8AF1
SceSvcCtrl_683998F2
SceSvcCtrl_8BEB8B7C
SceSvcCtrl_B21BE499

SceIpmi

Common

sceShellSvcShutterSoundPlay usage

sceShellSvcShutterSoundPlay can be used to play shutter sound only.

int sceShellSvcShutterSoundPlay(void) {
	int arg_a3 = 0, arg_a5[2];
	arg_a5[0] = 0;
	arg_a5[1] = 0; // sound type?
	SceShellSvcTable *table = *sceShellSvcGetSvcObj();
	table->sceShellSvcAudioControl(ptr, 0x140000, &arg_a3, 1, arg_a5, 0, 0);
	return 0;
}

SceTextClipboardStorage usage

SceTextClipboardStorage is a cached memory block with usable size of 0x1FFD bytes allocated by SceShellSvc on startup. Normally you would access this storage with clipboard sysmodule, however it can also be accessed directly with SceShellSvc functions. This memory can be accesed from any part of the system and is managed by SceShell. For example, you can write to it in one application and access written data from the other. Or you can write to it in application and access written data from a plugin.