PS2SDK
PS2 Homebrew Libraries
osd_config.h
Go to the documentation of this file.
1 /*
2 # _____ ___ ____ ___ ____
3 # ____| | ____| | | |____|
4 # | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
5 #-----------------------------------------------------------------------
6 # Copyright 2001-2004, ps2dev - http://www.ps2dev.org
7 # Licenced under Academic Free License version 2.0
8 # Review ps2sdk README & LICENSE files for further details.
9 */
10 
24 #ifndef __OSD_CONFIG_H__
25 #define __OSD_CONFIG_H__
26 
27 #include <tamtypes.h>
28 #include <rom0_info.h>
29 #ifndef OSD_CONFIG_NO_LIBCDVD
30 #include <libcdvd.h>
31 #endif
32 
35  LANGUAGE_JAPANESE = 0,
36  LANGUAGE_ENGLISH,
37  LANGUAGE_FRENCH,
38  LANGUAGE_SPANISH,
39  LANGUAGE_GERMAN,
40  LANGUAGE_ITALIAN,
41  LANGUAGE_DUTCH,
42  LANGUAGE_PORTUGUESE,
43  /* Language values after here are not officially documented.
44  Are supported by neither this library nor the original Sony libscf library,
45  but can be found in the MECHACON's NVRAM and are used exclusively by the OSDs of consoles that support these languages.
46  However, these consoles will always specify English within ConfigParam.
47 
48  When ConfigParam.version is 2, the true language can be found in Config2Param.language. */
49  LANGUAGE_RUSSIAN,
50  LANGUAGE_KOREAN,
51  LANGUAGE_TRAD_CHINESE,
52  LANGUAGE_SIMPL_CHINESE
53 };
54 
57  TV_SCREEN_43 = 0,
58  TV_SCREEN_FULL,
59  TV_SCREEN_169
60 };
61 
64  VIDEO_OUTPUT_RGB = 0,
65  VIDEO_OUTPUT_COMPONENT
66 };
67 
70  DATE_YYYYMMDD = 0,
71  DATE_MMDDYYYY,
72  DATE_DDMMYYYY
73 };
74 
77  TIME_24H = 0,
78  TIME_12H,
79 };
80 
82 typedef struct
83 {
85  /*00*/ u32 spdifMode : 1;
87  /*01*/ u32 screenType : 2;
89  /*03*/ u32 videoOutput : 1;
91  /*04*/ u32 japLanguage : 1;
93  /*05*/ u32 ps1drvConfig : 8;
95  /*13*/ u32 version : 3;
97  /*16*/ u32 language : 5;
99  /*21*/ u32 timezoneOffset : 11;
100 } ConfigParam;
101 
105 typedef struct
106 {
107  /*00*/ u8 format;
108 
109  /*00*/ u8 reserved : 4;
111  /*04*/ u8 daylightSaving : 1;
113  /*05*/ u8 timeFormat : 1;
115  /*06*/ u8 dateFormat : 2;
116 
117  // Only used if ConfigParam.version = 2
119  /*00*/ u8 version;
121  /*00*/ u8 language;
122 } Config2Param;
123 
124 #ifdef __cplusplus
125 extern "C" {
126 #endif
127 
131 extern int configGetLanguage(void);
132 static inline int configGetLanguageWithIODriver(const _io_driver *driver) { return configGetLanguage(); }
133 
137 extern void configSetLanguage(int language);
138 static inline void configSetLanguageWithIODriver(int language, const _io_driver *driver) { configSetLanguage(language); }
139 
143 extern int configGetTvScreenType(void);
144 static inline int configGetTvScreenTypeWithIODriver(const _io_driver *driver) { return configGetTvScreenType(); }
145 
149 extern void configSetTvScreenType(int screenType);
150 static inline void configSetTvScreenTypeWithIODriver(int screenType, const _io_driver *driver) { configSetTvScreenType(screenType); }
151 
155 extern int configGetDateFormat(void);
156 static inline int configGetDateFormatWithIODriver(const _io_driver *driver) { return configGetDateFormat(); }
157 
161 extern void configSetDateFormat(int dateFormat);
162 static inline void configSetDateFormatWithIODriver(int dateFormat, const _io_driver *driver) { configSetDateFormat(dateFormat); }
163 
168 extern int configGetTimeFormat(void);
169 static inline int configGetTimeFormatWithIODriver(const _io_driver *driver) { return configGetTimeFormat(); }
170 
175 extern void configSetTimeFormat(int timeFormat);
176 static inline void configSetTimeFormatWithIODriver(int timeFormat, const _io_driver *driver) { configSetTimeFormat(timeFormat); }
177 
181 extern int configGetTimezone(void);
182 static inline int configGetTimezoneWithIODriver(const _io_driver *driver) { return configGetTimezone(); }
183 
187 extern void configSetTimezone(int offset);
188 static inline void configSetTimezoneWithIODriver(int offset, const _io_driver *driver, void *finishedCallback) { configSetTimezone(offset); }
189 
193 extern int configIsSpdifEnabled(void);
194 static inline int configIsSpdifEnabledWithIODriver(const _io_driver *driver) { return configIsSpdifEnabled(); }
195 
199 extern void configSetSpdifEnabled(int enabled);
200 static inline void configSetSpdifEnabledWithIODriver(int enabled, const _io_driver *driver) { configSetSpdifEnabled(enabled); }
201 
205 extern int configIsDaylightSavingEnabled(void);
206 static inline int configIsDaylightSavingEnabledWithIODriver(const _io_driver *driver) { return configIsDaylightSavingEnabled(); }
207 
211 extern void configSetDaylightSavingEnabled(int enabled);
212 static inline void configSetDaylightSavingEnabledWithIODriver(int enabled, const _io_driver *driver, void *finishedCallback) { configSetDaylightSavingEnabled(enabled); }
213 
214 #ifndef OSD_CONFIG_NO_LIBCDVD
215 
218 extern void configConvertToGmtTime(sceCdCLOCK *time);
219 
223 extern void configConvertToLocalTime(sceCdCLOCK *time);
224 static inline void configConvertToLocalTimeWithIODriver(sceCdCLOCK *time, const _io_driver *driver) { configConvertToLocalTime(time); }
225 #endif
226 
227 // Internal functions.
233 extern int IsEarlyJap(ConfigParam config);
234 
235 #ifdef __cplusplus
236 }
237 #endif
238 
239 #endif /* __OSD_CONFIG_H__ */
ConfigParam::videoOutput
u32 videoOutput
Definition: osd_config.h:89
OSD_LANGUAGES
OSD_LANGUAGES
Definition: osd_config.h:34
configSetTvScreenType
void configSetTvScreenType(int screenType)
Config2Param::timeFormat
u8 timeFormat
Definition: osd_config.h:113
IsEarlyJap
int IsEarlyJap(ConfigParam config)
ConfigParam::spdifMode
u32 spdifMode
Definition: osd_config.h:85
sceCdCLOCK
Definition: libcdvd-common.h:188
rom0_info.h
ConfigParam::language
u32 language
Definition: osd_config.h:97
configSetDaylightSavingEnabled
void configSetDaylightSavingEnabled(int enabled)
configGetTvScreenType
int configGetTvScreenType(void)
libcdvd.h
ConfigParam
Definition: osd_config.h:82
Config2Param::version
u8 version
Definition: osd_config.h:119
ConfigParam::version
u32 version
Definition: osd_config.h:95
ConfigParam::screenType
u32 screenType
Definition: osd_config.h:87
Config2Param::dateFormat
u8 dateFormat
Definition: osd_config.h:115
ConfigParam::timezoneOffset
u32 timezoneOffset
Definition: osd_config.h:99
configGetTimezone
int configGetTimezone(void)
configGetLanguage
int configGetLanguage(void)
configGetDateFormat
int configGetDateFormat(void)
_io_driver
Definition: rom0_info.h:24
configIsDaylightSavingEnabled
int configIsDaylightSavingEnabled(void)
ConfigParam::ps1drvConfig
u32 ps1drvConfig
Definition: osd_config.h:93
configGetTimeFormat
int configGetTimeFormat(void)
configSetTimeFormat
void configSetTimeFormat(int timeFormat)
configSetLanguage
void configSetLanguage(int language)
tamtypes.h
configConvertToGmtTime
void configConvertToGmtTime(sceCdCLOCK *time)
ConfigParam::japLanguage
u32 japLanguage
Definition: osd_config.h:91
configSetDateFormat
void configSetDateFormat(int dateFormat)
Config2Param
Definition: osd_config.h:105
Config2Param::language
u8 language
Definition: osd_config.h:121
TV_SCREEN_TYPES
TV_SCREEN_TYPES
Definition: osd_config.h:56
Config2Param::daylightSaving
u8 daylightSaving
Definition: osd_config.h:111
configSetSpdifEnabled
void configSetSpdifEnabled(int enabled)
configConvertToLocalTime
void configConvertToLocalTime(sceCdCLOCK *time)
VIDEO_OUTPUT_TYPES
VIDEO_OUTPUT_TYPES
Definition: osd_config.h:63
configSetTimezone
void configSetTimezone(int offset)
TIME_FORMAT_TYPES
TIME_FORMAT_TYPES
Definition: osd_config.h:76
configIsSpdifEnabled
int configIsSpdifEnabled(void)
DATE_FORMAT_TYPES
DATE_FORMAT_TYPES
Definition: osd_config.h:69