Skip to content

Commit 986ff32

Browse files
authored
Merge pull request #868 from uyjulian/rom0_info_use_iopheap
Use iopheap functions for rom0_info
2 parents baecd0e + 40382a7 commit 986ff32

6 files changed

Lines changed: 141 additions & 262 deletions

File tree

ee/kernel/Makefile

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -86,26 +86,26 @@ GLUE_OBJS += SyncDCache.o iSyncDCache.o InvalidDCache.o iInvalidDCache.o
8686
SIO_OBJS = sio_init.o sio_putc.o sio_getc.o sio_write.o sio_read.o sio_puts.o \
8787
sio_gets.o sio_getc_block.o sio_flush.o sio_putsn.o
8888

89-
ROM0_OBJS = _info_internals.o GetRomNameWithIODriver.o GetRomName.o IsDESRMachineWithIODriver.o IsDESRMachine.o IsT10KWithIODriver.o IsT10K.o
89+
ROM0_OBJS = _info_internals.o SetupRomInfo.o GetRomName.o IsDESRMachine.o IsT10K.o
9090

9191
### Config objects
9292

9393
CONFIG_OBJS = _config_internals.o converttobcd.o convertfrombcd.o __adjustTime.o IsEarlyJap.o \
94-
configGetLanguageWithIODriver.o configGetLanguage.o \
95-
configSetLanguageWithIODriver.o configSetLanguage.o \
96-
configGetTvScreenTypeWithIODriver.o configGetTvScreenType.o \
97-
configSetTvScreenTypeWithIODriver.o configSetTvScreenType.o \
98-
configGetDateFormatWithIODriver.o configGetDateFormat.o \
99-
configSetDateFormatWithIODriver.o configSetDateFormat.o \
100-
configGetTimeFormatWithIODriver.o configGetTimeFormat.o \
101-
configSetTimeFormatWithIODriver.o configSetTimeFormat.o \
102-
configGetTimezoneWithIODriver.o configGetTimezone.o \
103-
configSetTimezoneWithIODriver.o configSetTimezone.o \
104-
configIsSpdifEnabledWithIODriver.o configIsSpdifEnabled.o \
105-
configSetSpdifEnabledWithIODriver.o configSetSpdifEnabled.o \
106-
configIsDaylightSavingEnabledWithIODriver.o configIsDaylightSavingEnabled.o \
107-
configSetDaylightSavingEnabledWithIODriver.o configSetDaylightSavingEnabled.o \
108-
configConvertToGmtTime.o configConvertToLocalTimeWithIODriver.o configConvertToLocalTime.o
94+
configGetLanguage.o \
95+
configSetLanguage.o \
96+
configGetTvScreenType.o \
97+
configSetTvScreenType.o \
98+
configGetDateFormat.o \
99+
configSetDateFormat.o \
100+
configGetTimeFormat.o \
101+
configSetTimeFormat.o \
102+
configGetTimezone.o \
103+
configSetTimezone.o \
104+
configIsSpdifEnabled.o \
105+
configSetSpdifEnabled.o \
106+
configIsDaylightSavingEnabled.o \
107+
configSetDaylightSavingEnabled.o \
108+
configConvertToGmtTime.o configConvertToLocalTime.o
109109

110110
### Patch objects
111111

ee/kernel/include/osd_config.h

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -129,95 +129,99 @@ extern "C" {
129129
* @return Language value (See OSD_LANGUAGES above)
130130
*/
131131
extern int configGetLanguage(void);
132-
extern int configGetLanguageWithIODriver(_io_driver *driver);
132+
static inline int configGetLanguageWithIODriver(const _io_driver *driver) { return configGetLanguage(); }
133133

134134
/** sets the default language of the ps2
135135
* @param language Language value (See OSD_LANGUAGES above)
136136
*/
137137
extern void configSetLanguage(int language);
138-
extern void configSetLanguageWithIODriver(int language, _io_driver *driver);
139-
138+
static inline void configSetLanguageWithIODriver(int language, const _io_driver *driver) { configSetLanguage(language); }
140139

141140
/** get the tv screen type the ps2 is setup for
142141
* @return 0 = 4:3; 1 = fullscreen; 2 = 16:9
143142
*/
144143
extern int configGetTvScreenType(void);
145-
extern int configGetTvScreenTypeWithIODriver(_io_driver *driver);
144+
static inline int configGetTvScreenTypeWithIODriver(const _io_driver *driver) { return configGetTvScreenType(); }
146145

147146
/** set the tv screen type
148147
* @param screenType 0 = 4:3; 1 = fullscreen; 2 = 16:9
149148
*/
150149
extern void configSetTvScreenType(int screenType);
151-
extern void configSetTvScreenTypeWithIODriver(int screenType, _io_driver *driver);
150+
static inline void configSetTvScreenTypeWithIODriver(int screenType, const _io_driver *driver) { configSetTvScreenType(screenType); }
152151

153152
/** gets the date display format
154153
* @return 0 = yyyy/mm/dd; 1 = mm/dd/yyyy; 2 = dd/mm/yyyy
155154
*/
156155
extern int configGetDateFormat(void);
157-
extern int configGetDateFormatWithIODriver(_io_driver *driver);
156+
static inline int configGetDateFormatWithIODriver(const _io_driver *driver) { return configGetDateFormat(); }
158157

159158
/** sets the date display format
160159
* @param dateFormat 0 = yyyy/mm/dd; 1 = mm/dd/yyyy; 2 = dd/mm/yyyy
161160
*/
162161
extern void configSetDateFormat(int dateFormat);
163-
extern void configSetDateFormatWithIODriver(int dateFormat, _io_driver *driver);
162+
static inline void configSetDateFormatWithIODriver(int dateFormat, const _io_driver *driver) { configSetDateFormat(dateFormat); }
164163

165164
/** gets the time display format
166165
* (whether 24hour time or not)
167166
* @return 0 = 24hour; 1 = 12hour
168167
*/
169168
extern int configGetTimeFormat(void);
170-
extern int configGetTimeFormatWithIODriver(_io_driver *driver);
169+
static inline int configGetTimeFormatWithIODriver(const _io_driver *driver) { return configGetTimeFormat(); }
171170

172171
/** sets the time display format
173172
* (whether 24hour time or not)
174173
* @param timeFormat 0 = 24hour; 1 = 12hour
175174
*/
176175
extern void configSetTimeFormat(int timeFormat);
177-
extern void configSetTimeFormatWithIODriver(int timeFormat, _io_driver *driver);
176+
static inline void configSetTimeFormatWithIODriver(int timeFormat, const _io_driver *driver) { configSetTimeFormat(timeFormat); }
178177

179178
/** get timezone
180179
* @return offset in minutes from GMT
181180
*/
182181
extern int configGetTimezone(void);
183-
extern int configGetTimezoneWithIODriver(_io_driver *driver);
182+
static inline int configGetTimezoneWithIODriver(const _io_driver *driver) { return configGetTimezone(); }
184183

185184
/** set timezone
186185
* @param offset offset in minutes from GMT
187186
*/
188187
extern void configSetTimezone(int offset);
189-
extern void configSetTimezoneWithIODriver(int timezoneOffset, _io_driver *driver, void (*finishedCallback)(void));
188+
static inline void configSetTimezoneWithIODriver(int offset, const _io_driver *driver, void *finishedCallback) { configSetTimezone(offset); }
190189

191190
/** checks whether the spdif is enabled or not
192191
* @return 1 = on; 0 = off
193192
*/
194193
extern int configIsSpdifEnabled(void);
195-
extern int configIsSpdifEnabledWithIODriver(_io_driver *driver);
194+
static inline int configIsSpdifEnabledWithIODriver(const _io_driver *driver) { return configIsSpdifEnabled(); }
196195

197196
/** sets whether the spdif is enabled or not
198197
* @param enabled 1 = on; 0 = off
199198
*/
200199
extern void configSetSpdifEnabled(int enabled);
201-
extern void configSetSpdifEnabledWithIODriver(int enabled, _io_driver *driver);
200+
static inline void configSetSpdifEnabledWithIODriver(int enabled, const _io_driver *driver) { configSetSpdifEnabled(enabled); }
202201

203202
/** checks whether daylight saving is currently set
204203
* @return 1 = on; 0 = off
205204
*/
206205
extern int configIsDaylightSavingEnabled(void);
207-
extern int configIsDaylightSavingEnabledWithIODriver(_io_driver *driver);
206+
static inline int configIsDaylightSavingEnabledWithIODriver(const _io_driver *driver) { return configIsDaylightSavingEnabled(); }
208207

209208
/** sets daylight saving
210209
* @param enabled 1 = on; 0 = off
211210
*/
212211
extern void configSetDaylightSavingEnabled(int enabled);
213-
extern void configSetDaylightSavingEnabledWithIODriver(int daylightSaving, _io_driver *driver, void (*finishedCallback)(void));
212+
static inline void configSetDaylightSavingEnabledWithIODriver(int enabled, const _io_driver *driver, void *finishedCallback) { configSetDaylightSavingEnabled(enabled); }
214213

215214
#ifndef OSD_CONFIG_NO_LIBCDVD
216215
/** converts the time returned from the ps2's clock into GMT time
217216
* (ps2 clock is in JST time)
218217
*/
219218
extern void configConvertToGmtTime(sceCdCLOCK *time);
220-
extern void configConvertToLocalTimeWithIODriver(sceCdCLOCK *time, _io_driver *driver);
219+
220+
/** converts the time returned from the ps2's clock into local time
221+
* (ps2 clock is in JST time)
222+
*/
223+
extern void configConvertToLocalTime(sceCdCLOCK *time);
224+
static inline void configConvertToLocalTimeWithIODriver(sceCdCLOCK *time, const _io_driver *driver) { configConvertToLocalTime(time); }
221225
#endif
222226

223227
// Internal functions.

ee/kernel/include/rom0_info.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,21 @@ typedef struct {
2828
int openFlags;
2929
} _io_driver;
3030

31+
extern void SetupRomInfo(void);
32+
3133
/** check whether the PlayStation 2 is actually a DESR-XXXX machine
3234
*
3335
* @return 1 if DESR-XXXX machine; 0 if not
3436
*/
3537
extern int IsDESRMachine(void);
36-
extern int IsDESRMachineWithIODriver(_io_driver *driver);
38+
static inline int IsDESRMachineWithIODriver(const _io_driver *driver) { return IsDESRMachine(); }
3739

3840
/** check whether the PlayStation 2 is actually a TOOL DTL-T10000(H)
3941
*
4042
* @return 1 if DTL-T10000(H); 0 if not
4143
*/
4244
extern int IsT10K(void);
43-
extern int IsT10KWithIODriver(_io_driver *driver);
45+
static inline int IsT10KWithIODriver(const _io_driver *driver) { return IsT10K(); }
4446

4547
/** gets the romname from the current ps2
4648
* 14 chars - doesnt set a null terminator
@@ -49,7 +51,7 @@ extern int IsT10KWithIODriver(_io_driver *driver);
4951
* @return pointer to buffer containing romname
5052
*/
5153
extern char *GetRomName(char *romname);
52-
extern char *GetRomNameWithIODriver(char *romname, _io_driver *driver);
54+
static inline char *GetRomNameWithIODriver(char *romname, const _io_driver *driver) { return GetRomName(romname); }
5355

5456
#ifdef __cplusplus
5557
}

0 commit comments

Comments
 (0)