psl1ght
A free SDK for Sony's PS3 console
Loading...
Searching...
No Matches
game.h
Go to the documentation of this file.
1#ifndef __LV2_SYSUTIL_GAME_H__
2#define __LV2_SYSUTIL_GAME_H__
3
4#include <ppu-types.h>
5#include <ppu-asm.h>
6
7
8/*
9 * constants
10 */
11
12/* Attribute / boot */
13#define SYS_GAME_ATTRIBUTE_PATCH (1 <<0) /* boot Patch */
14#define SYS_GAME_ATTRIBUTE_APP_HOME (1 <<1) /* boot from / app_home/PS3_GAME */
15#define SYS_GAME_ATTRIBUTE_DEBUG (1 <<2) /* start with Debug Mode */
16#define SYS_GAME_ATTRIBUTE_XMBBUY (1 <<3) /* restart of the utility purchases Game */
17#define SYS_GAME_ATTRIBUTE_COMMERCE2_BROWSER (1 <<4) /* restart from Commerce2Browser */
18#define SYS_GAME_ATTRIBUTE_INVITE_MESSAGE (1 <<5) /* boot from the invitation Title */
19#define SYS_GAME_ATTRIBUTE_CUSTOM_DATA_MESSAGE (1 <<6) /* start with the attached conditions data */
20#define SYS_GAME_ATTRIBUTE_WEB_BROWSER (1 <<8) /* restart from WebBrowser */
21
22/* Options operation theme file installation */
23#define SYS_GAME_THEME_OPTION_NONE (0) /* No option */
24#define SYS_GAME_THEME_OPTION_APPLY (1 <<0) /* to be applied after the Installation */
25
26/* Code function exit callback */
27#define SYS_GAME_CBRESULT_OK (0) /* exit store data */
28#define SYS_GAME_CBRESULT_OK_CANCEL (1) /* exit to cancel Theme Installation */
29
30#define SYS_GAME_SIZEKB_NOTCALC (-1) /* Directory Size is not calculated */
31#define SYS_GAME_THEMEINSTALL_BUFSIZE_MIN (4096) /* Size of the minimum buffer Theme Installation */
32
33
34#ifdef __cplusplus
35extern "C" {
36#endif
37
38/*
39 * enumerations
40 */
41
42/* PARAM.SFO parameters */
44{
45 SYS_GAME_SYSP_LANGUAGE_NUM = 20, /* number of languages */
46 SYS_GAME_SYSP_TITLE_SIZE = 128, /* TITLE size */
47 SYS_GAME_SYSP_TITLEID_SIZE = 10, /* TITLE_ID size */
48 SYS_GAME_SYSP_VERSION_SIZE = 6, /* Content Version Size */
49 SYS_GAME_SYSP_PS3_SYSTEM_VER_SIZE = 8, /* Runtime Library Release Version size */
50 SYS_GAME_SYSP_APP_VER_SIZE = 6 /* System Patches Version size */
52
53/* PARAM.SFO, ID setting information acquisition */
84
85/* error dialog */
86typedef enum sys_game_error
87{
88 SYS_GAME_ERRDIALOG_BROKEN_GAMEDATA = 0, /* corruption error */
89 SYS_GAME_ERRDIALOG_BROKEN_HDDGAME, /* corruption error */
91
92 SYS_GAME_ERRDIALOG_BROKEN_EXIT_GAMEDATA = 100, /* corruption error */
96
97/* E Set the supported rendering resolution resolution settings corresponding drawing */
99{
100 SYS_GAME_RESOLUTION_1080 = 0x08, /* 1080 */
101 SYS_GAME_RESOLUTION_720 = 0x04, /* 720 */
102 SYS_GAME_RESOLUTION_576SQ = 0x20, /* Wide screen of 576 */
103 SYS_GAME_RESOLUTION_576 = 0x02, /* 576 */
104 SYS_GAME_RESOLUTION_480SQ = 0x10, /* Wide screen of 480 */
105 SYS_GAME_RESOLUTION_480 = 0x01 /* 480 */
107
108/* Set the supported sound format audio formats support setting */
110{
111 SYS_GAME_SOUNDFORMAT_71LPCM = 0x10, /* 7.1ch LPCM */
112 SYS_GAME_SOUNDFORMAT_51LPCM = 0x04, /* 5.1ch LPCM */
113 SYS_GAME_SOUNDFORMAT_51DDENC = 0x102, /* Dolby Digital */
114 SYS_GAME_SOUNDFORMAT_51DTSENC = 0x202, /* DTS Digital Surround */
115 SYS_GAME_SOUNDFORMAT_2LPCM = 0x01, /* 2ch LPCM */
117
118/* Disc type */
125
126
127/*
128 * structures
129 */
130
131/* Directory Size *Information */
138
139/* for setting the initial value PARAM.SFO Parameters */
147
148
149/*
150 * callbacks
151 */
152
153typedef s32 (*sysGameThemeInstallCallback)(u32 fileOffset, u32 readSize, void *buf);
154typedef void (*sysGameDiscEjectCallback)(void);
155typedef void (*sysGameDiscInsertCallback)(u32 discType, char *titleId);
156
157
158/*
159 * functions
160 */
161
162s32 sysGameDataCheck(u32 type, const char *dirName, sysGameContentSize *size);
163s32 sysGameBootCheck(u32 *type, u32 *attributes, sysGameContentSize *size, char *dirName);
165s32 sysGameCreateGameData(sysGameSetInitParams *init, char *tmp_contentInfoPath, char *tmp_usrdirPath);
166s32 sysGameGetParamInt(s32 id, s32 *value);
167s32 sysGameGetParamString(s32 id, char *buf, u32 bufsize);
168s32 sysGameGetSizeKB(s32 *sizeKB);
169s32 sysGameSetParamString(s32 id, const char *buf);
171s32 sysGameContentPermit(char *contentInfoPath, char *usrdirPath);
172s32 sysGameContentErrorDialog(s32 type, s32 errNeedSizeKB, const char *dirName);
173s32 sysGameThemeInstall(const char *usrdirPath, const char *fileName, u32 option);
174s32 sysGameThemeInstallFromBuffer(u32 fileSize, u32 bufSize, void *buf, sysGameThemeInstallCallback cb, u32 option);
175s32 sysGameGetLocalWebContentPath(char *contentPath);
176s32 sysGameDeleteGameData(const char *dirName);
179
180#ifdef __cplusplus
181 }
182#endif
183
184#endif /* __LV2_SYSUTIL_GAME_H__ */
185
s32 sysGameContentPermit(char *contentInfoPath, char *usrdirPath)
s32 sysGameGetParamString(s32 id, char *buf, u32 bufsize)
s32 sysGameThemeInstallFromBuffer(u32 fileSize, u32 bufSize, void *buf, sysGameThemeInstallCallback cb, u32 option)
sys_game_resolution
Definition game.h:99
@ SYS_GAME_RESOLUTION_720
Definition game.h:101
@ SYS_GAME_RESOLUTION_480
Definition game.h:105
@ SYS_GAME_RESOLUTION_480SQ
Definition game.h:104
@ SYS_GAME_RESOLUTION_576
Definition game.h:103
@ SYS_GAME_RESOLUTION_576SQ
Definition game.h:102
@ SYS_GAME_RESOLUTION_1080
Definition game.h:100
enum sys_game_params sysGameParams
void(* sysGameDiscEjectCallback)(void)
Definition game.h:154
s32 sysGameUnregisterDiscChangeCallback(void)
s32(* sysGameThemeInstallCallback)(u32 fileOffset, u32 readSize, void *buf)
Definition game.h:153
s32 sysGameGetDiscContentInfoUpdatePath(char *updatePath)
s32 sysGameThemeInstall(const char *usrdirPath, const char *fileName, u32 option)
enum sys_game_system_param_size sysGameSystemParamSize
s32 sysGameBootCheck(u32 *type, u32 *attributes, sysGameContentSize *size, char *dirName)
struct sys_game_content_size sysGameContentSize
s32 sysGameDeleteGameData(const char *dirName)
s32 sysGameContentErrorDialog(s32 type, s32 errNeedSizeKB, const char *dirName)
enum sys_game_resolution sysGameResolution
sys_game_system_param_size
Definition game.h:44
@ SYS_GAME_SYSP_TITLEID_SIZE
Definition game.h:47
@ SYS_GAME_SYSP_VERSION_SIZE
Definition game.h:48
@ SYS_GAME_SYSP_TITLE_SIZE
Definition game.h:46
@ SYS_GAME_SYSP_PS3_SYSTEM_VER_SIZE
Definition game.h:49
@ SYS_GAME_SYSP_APP_VER_SIZE
Definition game.h:50
@ SYS_GAME_SYSP_LANGUAGE_NUM
Definition game.h:45
enum sys_game_sound_format sysGameSoundFormat
enum sys_game_disc_type sysGameDiscType
enum sys_game_error sysGameError
s32 sysGamePatchCheck(sysGameContentSize *size, void *reserved)
s32 sysGameDataCheck(u32 type, const char *dirName, sysGameContentSize *size)
s32 sysGameSetParamString(s32 id, const char *buf)
sys_game_sound_format
Definition game.h:110
@ SYS_GAME_SOUNDFORMAT_71LPCM
Definition game.h:111
@ SYS_GAME_SOUNDFORMAT_51DTSENC
Definition game.h:114
@ SYS_GAME_SOUNDFORMAT_2LPCM
Definition game.h:115
@ SYS_GAME_SOUNDFORMAT_51LPCM
Definition game.h:112
@ SYS_GAME_SOUNDFORMAT_51DDENC
Definition game.h:113
void(* sysGameDiscInsertCallback)(u32 discType, char *titleId)
Definition game.h:155
s32 sysGameGetSizeKB(s32 *sizeKB)
sys_game_disc_type
Definition game.h:120
@ SYS_GAME_DISCTYPE_PS3
Definition game.h:122
@ SYS_GAME_DISCTYPE_OTHER
Definition game.h:121
@ SYS_GAME_DISCTYPE_PS2
Definition game.h:123
sys_game_error
Definition game.h:87
@ SYS_GAME_ERRDIALOG_BROKEN_EXIT_HDDGAME
Definition game.h:93
@ SYS_GAME_ERRDIALOG_NOSPACE_EXIT
Definition game.h:94
@ SYS_GAME_ERRDIALOG_BROKEN_EXIT_GAMEDATA
Definition game.h:92
@ SYS_GAME_ERRDIALOG_BROKEN_GAMEDATA
Definition game.h:88
@ SYS_GAME_ERRDIALOG_BROKEN_HDDGAME
Definition game.h:89
@ SYS_GAME_ERRDIALOG_NOSPACE
Definition game.h:90
s32 sysGameGetParamInt(s32 id, s32 *value)
s32 sysGameRegisterDiscChangeCallback(sysGameDiscEjectCallback cbEject, sysGameDiscInsertCallback cbInsert)
sys_game_params
Definition game.h:55
@ SYS_GAME_PARAMID_TITLE_ID
Definition game.h:76
@ SYS_GAME_PARAMID_TITLE_JAPANESE
Definition game.h:58
@ SYS_GAME_PARAMID_RESOLUTION
Definition game.h:79
@ SYS_GAME_PARAMID_TITLE_SWEDISH
Definition game.h:71
@ SYS_GAME_PARAMID_TITLE_DEFAULT
Definition game.h:57
@ SYS_GAME_PARAMID_TITLE_DANISH
Definition game.h:72
@ SYS_GAME_PARAMID_VERSION
Definition game.h:77
@ SYS_GAME_PARAMID_TITLE_DUTCH
Definition game.h:64
@ SYS_GAME_PARAMID_TITLE_POLISH
Definition game.h:74
@ SYS_GAME_PARAMID_TITLE_NORWEGIAN
Definition game.h:73
@ SYS_GAME_PARAMID_TITLE_CHINESE_S
Definition game.h:69
@ SYS_GAME_PARAMID_TITLE_CHINESE_T
Definition game.h:68
@ SYS_GAME_PARAMID_SOUND_FORMAT
Definition game.h:80
@ SYS_GAME_PARAMID_TITLE_SPANISH
Definition game.h:61
@ SYS_GAME_PARAMID_TITLE_FRENCH
Definition game.h:60
@ SYS_GAME_PARAMID_PS3_SYSTEM_VER
Definition game.h:81
@ SYS_GAME_PARAMID_TITLE_ENGLISH
Definition game.h:59
@ SYS_GAME_PARAMID_TITLE_PORTUGUESE
Definition game.h:65
@ SYS_GAME_PARAMID_TITLE_RUSSIAN
Definition game.h:66
@ SYS_GAME_PARAMID_APP_VER
Definition game.h:82
@ SYS_GAME_PARAMID_PARENTAL_LEVEL
Definition game.h:78
@ SYS_GAME_PARAMID_TITLE
Definition game.h:56
@ SYS_GAME_PARAMID_TITLE_KOREAN
Definition game.h:67
@ SYS_GAME_PARAMID_TITLE_ITALIAN
Definition game.h:63
@ SYS_GAME_PARAMID_TITLE_GERMAN
Definition game.h:62
@ SYS_GAME_PARAMID_TITLE_FINNISH
Definition game.h:70
s32 sysGameGetLocalWebContentPath(char *contentPath)
struct sys_game_set_init_params sysGameSetInitParams
s32 sysGameCreateGameData(sysGameSetInitParams *init, char *tmp_contentInfoPath, char *tmp_usrdirPath)
uintptr_t size
Definition heap.h:1
uint64_t uint32_t value
Definition spu_atomic.h:59
char title[SYS_GAME_SYSP_TITLE_SIZE]
Definition game.h:141
char titleId[SYS_GAME_SYSP_TITLEID_SIZE]
Definition game.h:142
char version[SYS_GAME_SYSP_VERSION_SIZE]
Definition game.h:144