vitasdk
Documentation of the vitasdk

Exports for User. More...

Data Structures

struct  SceErrorString
 
struct  SceErrorDefaultFormat
 
struct  SceErrorHistoryPostInfo
 
struct  SceErrorHistoryInfo
 
struct  SceErrorSequenceInfo
 

Functions

 VITASDK_BUILD_ASSERT_EQ (0x10, SceErrorString)
 
int _sceErrorGetExternalString (char *error_string, int error_code)
 Convert an internal error code to its formatted external error code.
 
 VITASDK_BUILD_ASSERT_EQ (8, SceErrorDefaultFormat)
 
 VITASDK_BUILD_ASSERT_EQ (0x180, SceErrorHistoryPostInfo)
 
 VITASDK_BUILD_ASSERT_EQ (0x1B0, SceErrorHistoryInfo)
 
 VITASDK_BUILD_ASSERT_EQ (0x20, SceErrorSequenceInfo)
 
int _sceErrorHistoryClearError (int zero)
 Clear the in-memory error history and remove vd0:history/data.bin.
 
int _sceErrorHistoryGetError (SceUInt32 error_idx, SceErrorHistoryInfo *info)
 Get an error-history entry.
 
int _sceErrorHistoryPostError (const SceErrorHistoryPostInfo *info)
 Post an error-history entry.
 
int _sceErrorHistorySetDefaultFormat (const SceErrorDefaultFormat *format)
 Set the default network status for error-history entries posted later.
 
int _sceErrorHistoryUpdateSequenceInfo (const SceErrorSequenceInfo *info, int zero)
 Update the flags of an error-history entry.
 

Variables

char SceErrorString::s [16]
 NUL-terminated formatted external error code, for example "C2-12828-1".
 
SceInt32 SceErrorDefaultFormat::network_status
 Default network status; not validated. Settings maps 3..5 to NAT types 1..3.
 
SceInt32 SceErrorDefaultFormat::enable
 Must be exactly 1. The default remains enabled until SceError is reloaded.
 
char SceErrorHistoryPostInfo::error_message [0x100]
 NUL-terminated diagnostic message. Termination is not validated on FW 3.60.
 
SceUInt32 SceErrorHistoryPostInfo::suggested_actions [15]
 Suggested-action IDs used by the Settings UI.
 
SceUInt8 SceErrorHistoryPostInfo::reserved0 [2]
 Reserved; copied into history unchanged.
 
SceUInt8 SceErrorHistoryPostInfo::suggested_action_count
 Number of valid actions; must be <= 15. FW 3.60 does not check it.
 
SceUInt8 SceErrorHistoryPostInfo::reserved1
 Reserved; copied into history unchanged.
 
int SceErrorHistoryPostInfo::error_code_hex
 Internal error code.
 
SceUInt32 SceErrorHistoryPostInfo::application_code
 Application error number displayed as XX-XXX-XXX.
 
SceUInt SceErrorHistoryPostInfo::version
 Set by SceError from SceKernelSystemSwVersion::version; the caller-provided value is ignored.
 
SceInt32 SceErrorHistoryPostInfo::network_status
 Unchecked unless overridden; Settings maps 3..5 to NAT types 1..3.
 
char SceErrorHistoryPostInfo::titleid [0xC]
 NUL-terminated title ID; not validated. Duplicate checks use its first 10 bytes.
 
SceUInt32 SceErrorHistoryPostInfo::system_software_version_unk24
 Set from SceKernelSystemSwVersion::unk_24; input is ignored.
 
SceUInt8 SceErrorHistoryPostInfo::reserved2 [0x20]
 Cleared by SceError before the entry is stored.
 
SceUInt8 SceErrorHistoryInfo::reserved0
 Zero-initialized for newly posted entries.
 
SceUInt8 SceErrorHistoryInfo::flags
 Bit 0 is set when Settings opens the entry.
 
SceUInt8 SceErrorHistoryInfo::sequence_id
 Matched together with time when updating the entry.
 
SceUInt8 SceErrorHistoryInfo::reserved1
 Zero-initialized for newly posted entries.
 
SceUInt32 SceErrorHistoryInfo::reserved2
 Zero-initialized for newly posted entries.
 
SceInt64 SceErrorHistoryInfo::time
 Value of type SceRtcTick.
 
SceErrorString SceErrorHistoryInfo::error_code
 Formatted external error code.
 
SceUInt8 SceErrorHistoryInfo::reserved3 [0x10]
 Zero-initialized for newly posted entries.
 
SceErrorHistoryPostInfo SceErrorHistoryInfo::post
 Posted error information.
 
SceUInt8 SceErrorSequenceInfo::sequence_id
 Sequence identifier of the history entry to update.
 
SceUInt8 SceErrorSequenceInfo::flags
 Replacement flags for the matching history entry.
 
SceUInt8 SceErrorSequenceInfo::reserved0 [6]
 Ignored by SceError.
 
SceInt64 SceErrorSequenceInfo::time
 Value of type SceRtcTick.
 
SceUInt8 SceErrorSequenceInfo::reserved1 [0x10]
 Ignored by SceError.
 

Detailed Description

Exports for User.


Using this library in your project

Include the header file in your project:

#include <psp2/error.h>


Link the library to the executable:

SceError_stub




Data Structure Documentation

◆ SceErrorString

struct SceErrorString
Data Fields
char s[16] NUL-terminated formatted external error code, for example "C2-12828-1".

◆ SceErrorDefaultFormat

struct SceErrorDefaultFormat
Data Fields
SceInt32 network_status Default network status; not validated. Settings maps 3..5 to NAT types 1..3.
SceInt32 enable Must be exactly 1. The default remains enabled until SceError is reloaded.

◆ SceErrorHistoryPostInfo

struct SceErrorHistoryPostInfo
Data Fields
char error_message[0x100] NUL-terminated diagnostic message. Termination is not validated on FW 3.60.
SceUInt32 suggested_actions[15] Suggested-action IDs used by the Settings UI.
SceUInt8 reserved0[2] Reserved; copied into history unchanged.
SceUInt8 suggested_action_count Number of valid actions; must be <= 15. FW 3.60 does not check it.
SceUInt8 reserved1 Reserved; copied into history unchanged.
int error_code_hex Internal error code.
SceUInt32 application_code Application error number displayed as XX-XXX-XXX.
SceUInt version Set by SceError from SceKernelSystemSwVersion::version; the caller-provided value is ignored.
SceInt32 network_status Unchecked unless overridden; Settings maps 3..5 to NAT types 1..3.
char titleid[0xC] NUL-terminated title ID; not validated. Duplicate checks use its first 10 bytes.
SceUInt32 system_software_version_unk24 Set from SceKernelSystemSwVersion::unk_24; input is ignored.
SceUInt8 reserved2[0x20] Cleared by SceError before the entry is stored.

◆ SceErrorHistoryInfo

struct SceErrorHistoryInfo
Data Fields
SceUInt8 reserved0 Zero-initialized for newly posted entries.
SceUInt8 flags Bit 0 is set when Settings opens the entry.
SceUInt8 sequence_id Matched together with time when updating the entry.
SceUInt8 reserved1 Zero-initialized for newly posted entries.
SceUInt32 reserved2 Zero-initialized for newly posted entries.
SceInt64 time Value of type SceRtcTick.
SceErrorString error_code Formatted external error code.
SceUInt8 reserved3[0x10] Zero-initialized for newly posted entries.
SceErrorHistoryPostInfo post Posted error information.

◆ SceErrorSequenceInfo

struct SceErrorSequenceInfo
Data Fields
SceUInt8 sequence_id Sequence identifier of the history entry to update.
SceUInt8 flags Replacement flags for the matching history entry.
SceUInt8 reserved0[6] Ignored by SceError.
SceInt64 time Value of type SceRtcTick.
SceUInt8 reserved1[0x10] Ignored by SceError.

Function Documentation

◆ VITASDK_BUILD_ASSERT_EQ() [1/5]

VITASDK_BUILD_ASSERT_EQ ( 0x10  ,
SceErrorString   
)

◆ _sceErrorGetExternalString()

int _sceErrorGetExternalString ( char *  error_string,
int  error_code 
)

Convert an internal error code to its formatted external error code.

Known public errors use PREFIX-number-checkdigit. Unknown errors use E-xxxxxxxx, and known non-public errors use *-xxxxxxxx. Hexadecimal digits are lowercase on FW 3.60. A non-NULL destination receives exactly 16 bytes, including the NUL terminator and zero padding.

Parameters
[out]error_string- Optional external error-code buffer. If non-NULL, it must point to at least 16 bytes.
[in]error_code- Internal error code.
Returns
0 on success, or a user-memory copy error.

◆ VITASDK_BUILD_ASSERT_EQ() [2/5]

VITASDK_BUILD_ASSERT_EQ ( 8  ,
SceErrorDefaultFormat   
)

◆ VITASDK_BUILD_ASSERT_EQ() [3/5]

VITASDK_BUILD_ASSERT_EQ ( 0x180  ,
SceErrorHistoryPostInfo   
)

◆ VITASDK_BUILD_ASSERT_EQ() [4/5]

VITASDK_BUILD_ASSERT_EQ ( 0x1B0  ,
SceErrorHistoryInfo   
)

◆ VITASDK_BUILD_ASSERT_EQ() [5/5]

VITASDK_BUILD_ASSERT_EQ ( 0x20  ,
SceErrorSequenceInfo   
)

◆ _sceErrorHistoryClearError()

int _sceErrorHistoryClearError ( int  zero)

Clear the in-memory error history and remove vd0:history/data.bin.

vd0:history/data.bak is not removed immediately. The empty history is written to both files on the next suspend event.

Parameters
[in]zero- Reserved. Must be 0.
Returns
0 on success, or 0x80010016 if zero is not 0.

◆ _sceErrorHistoryGetError()

int _sceErrorHistoryGetError ( SceUInt32  error_idx,
SceErrorHistoryInfo *  info 
)

Get an error-history entry.

Empty slots are returned as zero-filled records. For a non-NULL output and an invalid index, FW 3.60 also writes a zero-filled record before returning the error.

Parameters
[in]error_idx- Entry index. 0 is the newest entry and 9 is the oldest.
[out]info- The returned error-history entry.
Returns
0 on success, 0x80010016 for a NULL output or an index greater than 9, or a user-memory copy error.

◆ _sceErrorHistoryPostError()

int _sceErrorHistoryPostError ( const SceErrorHistoryPostInfo *  info)

Post an error-history entry.

SceError copies the record before returning. It replaces the system-version fields, conditionally replaces network_status with the registered default, clears reserved2, assigns the RTC timestamp and sequence ID, and generates the external error string. A prior entry with the same internal error code, application code, and first 10 title-ID bytes is removed. The history is not written to storage until a suspend event.

Parameters
[in]info- Error information to post.
Returns
0 on success, 0x80010016 for a NULL record, or a user-memory copy error.

◆ _sceErrorHistorySetDefaultFormat()

int _sceErrorHistorySetDefaultFormat ( const SceErrorDefaultFormat *  format)

Set the default network status for error-history entries posted later.

FW 3.60 provides no call to disable the default once enabled.

Parameters
[in]format- Default format. Its enable member must be 1.
Returns
0 on success, 0x80010016 for a NULL record or an enable value other than 1, or a user-memory copy error.

◆ _sceErrorHistoryUpdateSequenceInfo()

int _sceErrorHistoryUpdateSequenceInfo ( const SceErrorSequenceInfo *  info,
int  zero 
)

Update the flags of an error-history entry.

The entry is matched using both sequence_id and time.

Parameters
[in]info- Sequence information and replacement flags.
[in]zero- Reserved. Must be 0.
Returns
0 on success; 0x80010016 for a NULL record, a nonzero zero value, or no matching entry; or a user-memory copy error.

Variable Documentation

◆ s

char SceErrorString::s[16]

NUL-terminated formatted external error code, for example "C2-12828-1".

◆ network_status [1/2]

SceInt32 SceErrorDefaultFormat::network_status

Default network status; not validated. Settings maps 3..5 to NAT types 1..3.

◆ enable

SceInt32 SceErrorDefaultFormat::enable

Must be exactly 1. The default remains enabled until SceError is reloaded.

◆ error_message

char SceErrorHistoryPostInfo::error_message[0x100]

NUL-terminated diagnostic message. Termination is not validated on FW 3.60.

◆ suggested_actions

SceUInt32 SceErrorHistoryPostInfo::suggested_actions[15]

Suggested-action IDs used by the Settings UI.

◆ reserved0 [1/3]

SceUInt8 SceErrorHistoryPostInfo::reserved0[2]

Reserved; copied into history unchanged.

◆ suggested_action_count

SceUInt8 SceErrorHistoryPostInfo::suggested_action_count

Number of valid actions; must be <= 15. FW 3.60 does not check it.

◆ reserved1 [1/3]

SceUInt8 SceErrorHistoryPostInfo::reserved1

Reserved; copied into history unchanged.

◆ error_code_hex

int SceErrorHistoryPostInfo::error_code_hex

Internal error code.

◆ application_code

SceUInt32 SceErrorHistoryPostInfo::application_code

Application error number displayed as XX-XXX-XXX.

◆ version

SceUInt SceErrorHistoryPostInfo::version

Set by SceError from SceKernelSystemSwVersion::version; the caller-provided value is ignored.

◆ network_status [2/2]

SceInt32 SceErrorHistoryPostInfo::network_status

Unchecked unless overridden; Settings maps 3..5 to NAT types 1..3.

◆ titleid

char SceErrorHistoryPostInfo::titleid[0xC]

NUL-terminated title ID; not validated. Duplicate checks use its first 10 bytes.

◆ system_software_version_unk24

SceUInt32 SceErrorHistoryPostInfo::system_software_version_unk24

Set from SceKernelSystemSwVersion::unk_24; input is ignored.

◆ reserved2 [1/2]

SceUInt8 SceErrorHistoryPostInfo::reserved2[0x20]

Cleared by SceError before the entry is stored.

◆ reserved0 [2/3]

SceUInt8 SceErrorHistoryInfo::reserved0

Zero-initialized for newly posted entries.

◆ flags [1/2]

SceUInt8 SceErrorHistoryInfo::flags

Bit 0 is set when Settings opens the entry.

◆ sequence_id [1/2]

SceUInt8 SceErrorHistoryInfo::sequence_id

Matched together with time when updating the entry.

◆ reserved1 [2/3]

SceUInt8 SceErrorHistoryInfo::reserved1

Zero-initialized for newly posted entries.

◆ reserved2 [2/2]

SceUInt32 SceErrorHistoryInfo::reserved2

Zero-initialized for newly posted entries.

◆ time [1/2]

SceInt64 SceErrorHistoryInfo::time

Value of type SceRtcTick.

◆ error_code

SceErrorString SceErrorHistoryInfo::error_code

Formatted external error code.

◆ reserved3

SceUInt8 SceErrorHistoryInfo::reserved3[0x10]

Zero-initialized for newly posted entries.

◆ post

SceErrorHistoryPostInfo SceErrorHistoryInfo::post

Posted error information.

◆ sequence_id [2/2]

SceUInt8 SceErrorSequenceInfo::sequence_id

Sequence identifier of the history entry to update.

◆ flags [2/2]

SceUInt8 SceErrorSequenceInfo::flags

Replacement flags for the matching history entry.

◆ reserved0 [3/3]

SceUInt8 SceErrorSequenceInfo::reserved0[6]

Ignored by SceError.

◆ time [2/2]

SceInt64 SceErrorSequenceInfo::time

Value of type SceRtcTick.

◆ reserved1 [3/3]

SceUInt8 SceErrorSequenceInfo::reserved1[0x10]

Ignored by SceError.