diff --git a/include/appsupport.h b/include/appsupport.h index 4fca27c9a..66a6074eb 100644 --- a/include/appsupport.h +++ b/include/appsupport.h @@ -1,8 +1,6 @@ #ifndef __APP_SUPPORT_H #define __APP_SUPPORT_H -#include "include/iosupport.h" - #define APP_MODE_UPDATE_DELAY 240 #define APP_TITLE_MAX 128 diff --git a/include/bdmsupport.h b/include/bdmsupport.h index 5c85b1384..c4ac9489a 100644 --- a/include/bdmsupport.h +++ b/include/bdmsupport.h @@ -1,12 +1,8 @@ #ifndef __BDM_SUPPORT_H #define __BDM_SUPPORT_H -#include "include/iosupport.h" - #define BDM_MODE_UPDATE_DELAY MENU_UPD_DELAY_GENREFRESH -#include "include/mcemu.h" - typedef struct { int active; /* Activation flag */ diff --git a/include/cheatman.h b/include/cheatman.h index 7d828e4f3..0ae082756 100644 --- a/include/cheatman.h +++ b/include/cheatman.h @@ -25,15 +25,6 @@ #ifndef _CHEATMAN_H_ #define _CHEATMAN_H_ -#include "opl.h" -#include -#include -#include -#include -#include -#include -#include - #define CHEAT_VERSION "0.5.3.7" #define MAX_HOOKS 5 diff --git a/include/dia.h b/include/dia.h index 3466ad077..bd9d00926 100644 --- a/include/dia.h +++ b/include/dia.h @@ -1,8 +1,6 @@ #ifndef __DIA_H #define __DIA_H -#include "include/opl.h" - // UI dialog item definition typedef enum { // terminates the definition of dialog. Mandatory diff --git a/include/ethsupport.h b/include/ethsupport.h index 470ba59db..64a5b1378 100644 --- a/include/ethsupport.h +++ b/include/ethsupport.h @@ -1,11 +1,8 @@ #ifndef __ETH_SUPPORT_H #define __ETH_SUPPORT_H -#include "include/iosupport.h" - #define ETH_MODE_UPDATE_DELAY 300 -#include "include/mcemu.h" typedef struct { int active; /* Activation flag */ diff --git a/include/gui.h b/include/gui.h index a834d17f5..483daffc6 100644 --- a/include/gui.h +++ b/include/gui.h @@ -1,12 +1,6 @@ #ifndef __GUI_H #define __GUI_H -#include "include/iosupport.h" -#include "include/opl.h" -#include "include/texcache.h" -#include "include/dialogs.h" -#include "include/menu.h" - typedef enum { // Informs gui that init is over and main gui can be rendered GUI_INIT_DONE = 1, diff --git a/include/hdd.h b/include/hdd.h index ef571e931..8704ca7a0 100644 --- a/include/hdd.h +++ b/include/hdd.h @@ -1,6 +1,8 @@ #ifndef __HDD_H #define __HDD_H +#include + typedef struct { u32 start; // Sector address diff --git a/include/hddsupport.h b/include/hddsupport.h index ddbd94963..ef36032a2 100644 --- a/include/hddsupport.h +++ b/include/hddsupport.h @@ -1,7 +1,6 @@ #ifndef __HDD_SUPPORT_H #define __HDD_SUPPORT_H -#include "include/iosupport.h" #include "include/hdd.h" #define HDD_MODE_UPDATE_DELAY MENU_UPD_DELAY_NOUPDATE @@ -38,7 +37,6 @@ typedef struct u32 length; } apa_subs; -#include "include/mcemu.h" typedef struct { int active; /* Activation flag */ diff --git a/include/menu.h b/include/menu.h index 5452705e9..3561d1bb8 100644 --- a/include/menu.h +++ b/include/menu.h @@ -1,7 +1,6 @@ #ifndef __MENUSYS_H #define __MENUSYS_H -#include "include/config.h" #include "include/dia.h" typedef struct menu_hint_item diff --git a/include/opl.h b/include/opl.h index 453ab180e..d480a5d7d 100644 --- a/include/opl.h +++ b/include/opl.h @@ -1,15 +1,9 @@ #ifndef __OPL_H #define __OPL_H -#include #include #include -#include -#include "opl-hdd-ioctl.h" -#include -#include #include -#include #include #include #include @@ -17,33 +11,15 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include #include -#include #include #include -#include -#include -#include -#include -#include -#include -#include -#include "config.h" +#include "include/iosupport.h" +#include "include/mcemu.h" #include "include/hddsupport.h" #include "include/supportbase.h" #include "include/bdmsupport.h" - -// Last Played Auto Start -#include - // Master password for disabling the parental lock. #define OPL_PARENTAL_LOCK_MASTER_PASS "989765" diff --git a/include/system.h b/include/system.h index 2d9f8f1e8..491390322 100644 --- a/include/system.h +++ b/include/system.h @@ -1,8 +1,6 @@ #ifndef __SYSTEM_H #define __SYSTEM_H -#include "include/mcemu.h" - #define SYS_LOAD_MC_MODULES 0x01 #define SYS_LOAD_USB_MODULES 0x02 #define SYS_LOAD_ISOFS_MODULE 0x04 diff --git a/include/texcache.h b/include/texcache.h index 722d9a008..e978794ff 100644 --- a/include/texcache.h +++ b/include/texcache.h @@ -1,8 +1,6 @@ #ifndef __TEX_CACHE_H #define __TEX_CACHE_H -#include "include/iosupport.h" - /// A single cache entry... typedef struct { diff --git a/src/OSDHistory.c b/src/OSDHistory.c index d4bec4118..cbd4cd593 100644 --- a/src/OSDHistory.c +++ b/src/OSDHistory.c @@ -7,17 +7,10 @@ However, OPL does not need any of that, so it can be made simpler. */ -#include -#include + #include -#include -#include -#include -#include -#include -#include #include -#include +#include "include/opl.h" #include "include/util.h" #include "include/OSDHistory.h" diff --git a/src/appsupport.c b/src/appsupport.c index 443a7bf5f..25acbb5aa 100644 --- a/src/appsupport.c +++ b/src/appsupport.c @@ -7,10 +7,6 @@ #include "include/ioman.h" #include "include/util.h" -#include "include/bdmsupport.h" -#include "include/ethsupport.h" -#include "include/hddsupport.h" - #include static int appForceUpdate = 1; diff --git a/src/atlas.c b/src/atlas.c index 880c29e72..5a35d7cbb 100644 --- a/src/atlas.c +++ b/src/atlas.c @@ -4,8 +4,6 @@ Review OpenUsbLd README & LICENSE files for further details. */ -#include -#include #include "include/opl.h" #include "include/atlas.h" #include "include/renderman.h" diff --git a/src/bdmsupport.c b/src/bdmsupport.c index 5d06b9f7e..5e5be0bff 100644 --- a/src/bdmsupport.c +++ b/src/bdmsupport.c @@ -1,8 +1,6 @@ #include "include/opl.h" #include "include/lang.h" #include "include/gui.h" -#include "include/supportbase.h" -#include "include/bdmsupport.h" #include "include/util.h" #include "include/themes.h" #include "include/textures.h" @@ -14,6 +12,7 @@ #include "modules/iopcore/common/cdvd_config.h" #include +#include "opl-hdd-ioctl.h" #include #define NEWLIB_PORT_AWARE diff --git a/src/cheatman.c b/src/cheatman.c index 5fb538b10..cbe3a760e 100644 --- a/src/cheatman.c +++ b/src/cheatman.c @@ -22,9 +22,10 @@ * $Id$ */ -#include +#include "include/opl.h" #include "include/cheatman.h" #include "include/ioman.h" +#include static int gEnableCheat; // Enables PS2RD Cheat Engine - 0 for Off, 1 for On static int gCheatMode; // Cheat Mode - 0 Enable all cheats, 1 Cheats selected by user diff --git a/src/config.c b/src/config.c index c9ac92d73..8844ba0ed 100644 --- a/src/config.c +++ b/src/config.c @@ -8,7 +8,6 @@ #include "include/util.h" #include "include/ioman.h" #include "include/sound.h" -#include // FIXME: We should not need this function. // Use newlib's 'stat' to get GMT time. diff --git a/src/dia.c b/src/dia.c index 36cc84440..2936201dd 100644 --- a/src/dia.c +++ b/src/dia.c @@ -5,7 +5,7 @@ */ #include "include/opl.h" -#include "include/dia.h" +#include "include/dialogs.h" #include "include/gui.h" #include "include/lang.h" #include "include/pad.h" diff --git a/src/dialogs.c b/src/dialogs.c index ccb946611..344469ccc 100644 --- a/src/dialogs.c +++ b/src/dialogs.c @@ -1,12 +1,9 @@ -#include "include/dialogs.h" #include "include/opl.h" -#include "include/dia.h" +#include "include/dialogs.h" #include "include/lang.h" #include "include/gui.h" #include "include/guigame.h" -#include - // Network Config Menu struct UIItem diaNetConfig[] = { {UI_LABEL, 0, 1, 1, -1, 0, 0, {.label = {NULL, _STR_NETCONFIG}}}, diff --git a/src/ethsupport.c b/src/ethsupport.c index f0462fa42..26fd9da1d 100644 --- a/src/ethsupport.c +++ b/src/ethsupport.c @@ -1,8 +1,7 @@ #include "include/opl.h" +#include "include/mcemu.h" #include "include/lang.h" #include "include/gui.h" -#include "include/supportbase.h" -#include "include/ethsupport.h" #include "include/util.h" #include "include/renderman.h" #include "include/themes.h" @@ -12,9 +11,13 @@ #include "include/extern_irx.h" #include "include/cheatman.h" #include "modules/iopcore/common/cdvd_config.h" +#include "include/ethsupport.h" #define NEWLIB_PORT_AWARE #include // fileXioDevctl(ethBase, SMB_***) +#include +#include +#include #include "include/nbns.h" #include "httpclient.h" diff --git a/src/gui.c b/src/gui.c index 1f5874b37..eea4488e7 100644 --- a/src/gui.c +++ b/src/gui.c @@ -5,9 +5,9 @@ */ #include "include/opl.h" +#include "include/dialogs.h" #include "include/gui.h" #include "include/renderman.h" -#include "include/menu.h" #include "include/fntsys.h" #include "include/ioman.h" #include "include/lang.h" @@ -23,8 +23,6 @@ #include "include/sound.h" #include "include/guigame.h" -#include -#include #include // Last Played Auto Start diff --git a/src/guigame.c b/src/guigame.c index 8fa079a48..18ab6904a 100644 --- a/src/guigame.c +++ b/src/guigame.c @@ -4,12 +4,11 @@ */ #include "include/opl.h" +#include "include/dialogs.h" #include "include/gui.h" #include "include/ioman.h" #include "include/lang.h" #include "include/pad.h" -#include "include/config.h" -#include "include/ethsupport.h" #include "include/compatupd.h" #include "include/cheatman.h" #include "include/system.h" diff --git a/src/hdd.c b/src/hdd.c index 9f050b731..2b6130eaa 100644 --- a/src/hdd.c +++ b/src/hdd.c @@ -1,3 +1,4 @@ + #include "include/opl.h" #include "include/hdd.h" #include "include/ioman.h" @@ -5,6 +6,7 @@ #define NEWLIB_PORT_AWARE #include +#include "opl-hdd-ioctl.h" typedef struct // size = 1024 { diff --git a/src/hddsupport.c b/src/hddsupport.c index 7e58fdf96..5a771c50a 100644 --- a/src/hddsupport.c +++ b/src/hddsupport.c @@ -1,9 +1,7 @@ -#include "sys/fcntl.h" #include "include/opl.h" #include "include/lang.h" #include "include/gui.h" #include "include/supportbase.h" -#include "include/hddsupport.h" #include "include/util.h" #include "include/themes.h" #include "include/textures.h" @@ -18,6 +16,8 @@ #include // FIO_MT_RDWR #include +#include +#include "opl-hdd-ioctl.h" #define OPL_HDD_MODE_PS2LOGO_OFFSET 0x17F8 diff --git a/src/ioman.c b/src/ioman.c index 0945672d2..c9e4c1ffe 100644 --- a/src/ioman.c +++ b/src/ioman.c @@ -1,10 +1,5 @@ #include "include/opl.h" #include "include/ioman.h" -#include -#include -#include -#include -#include #ifdef __EESIO_DEBUG #include #endif diff --git a/src/menu.c b/src/menu.c index 506a35b5b..47db6b27c 100644 --- a/src/menu.c +++ b/src/menu.c @@ -5,8 +5,7 @@ */ #include "include/opl.h" -#include "include/menu.h" -#include "include/iosupport.h" +#include "include/dia.h" #include "include/renderman.h" #include "include/fntsys.h" #include "include/lang.h" diff --git a/src/opl.c b/src/opl.c index 6bb36495f..ca6f2a233 100644 --- a/src/opl.c +++ b/src/opl.c @@ -11,24 +11,15 @@ #include "include/renderman.h" #include "include/lang.h" #include "include/themes.h" -#include "include/textures.h" #include "include/pad.h" -#include "include/texcache.h" -#include "include/dia.h" #include "include/dialogs.h" -#include "include/menu.h" #include "include/system.h" -#include "include/debug.h" #include "include/config.h" #include "include/util.h" #include "include/compatupd.h" #include "include/extern_irx.h" #include "httpclient.h" - -#include "include/supportbase.h" -#include "include/bdmsupport.h" #include "include/ethsupport.h" -#include "include/hddsupport.h" #include "include/appsupport.h" #include "include/cheatman.h" @@ -41,14 +32,19 @@ #include // iox_stat_t int configGetStat(config_set_t *configSet, iox_stat_t *stat); -#include #ifdef PADEMU #include #include #endif +#include +#include +#include +#include + #ifdef __EESIO_DEBUG #include "SIOCookie.h" +#include "include/debug.h" #define LOG_INIT() ee_sio_start(38400, 0, 0, 0, 0, 1) #define LOG_ENABLE() \ do { \ @@ -1316,7 +1312,6 @@ static void compatUpdate(item_list_t *support, unsigned char mode, config_set_t clock.day = itob(stat.mtime[4]); clock.month = itob(stat.mtime[5]); clock.year = itob((stat.mtime[6] | ((unsigned short int)stat.mtime[7] << 8)) - 2000); - configConvertToGmtTime(&clock); mtime[0] = btoi(clock.year); // Year mtime[1] = btoi(clock.month) - 1; // Month @@ -1498,7 +1493,7 @@ static int loadLwnbdSvr(void) }; struct lwnbd_config config; - // deint audio lib while nbd server is running + // deinit audio lib and background music while nbd server is running audioEnd(); // block all io ops, wait for the ones still running to finish diff --git a/src/renderman.c b/src/renderman.c index 4d90251fc..f1e3a01de 100644 --- a/src/renderman.c +++ b/src/renderman.c @@ -4,8 +4,6 @@ Review OpenUsbLd README & LICENSE files for further details. */ -#include -#include #include "include/opl.h" #include "include/renderman.h" diff --git a/src/sound.c b/src/sound.c index cefb674ef..368ee0ede 100644 --- a/src/sound.c +++ b/src/sound.c @@ -3,20 +3,17 @@ Licenced under Academic Free License version 3.0 Review OpenPS2Loader README & LICENSE files for further details. */ - #include +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-variable" #include +#pragma GCC diagnostic pop #include "include/sound.h" #include "include/opl.h" #include "include/ioman.h" #include "include/themes.h" -// Silence unused variable warnings from vorbisfile.h -static ov_callbacks OV_CALLBACKS_NOCLOSE __attribute__((unused)); -static ov_callbacks OV_CALLBACKS_STREAMONLY __attribute__((unused)); -static ov_callbacks OV_CALLBACKS_STREAMONLY_NOCLOSE __attribute__((unused)); - /*-- Theme Sound Effects ---------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------*/ diff --git a/src/submenu.c b/src/submenu.c index e630d47de..a39610be4 100644 --- a/src/submenu.c +++ b/src/submenu.c @@ -6,7 +6,6 @@ */ #include "include/opl.h" -#include "include/submenu.h" #include "include/lang.h" #include "include/themes.h" diff --git a/src/supportbase.c b/src/supportbase.c index 8e03f767b..fe4a882dc 100644 --- a/src/supportbase.c +++ b/src/supportbase.c @@ -1,14 +1,10 @@ #include "include/opl.h" -#include "include/lang.h" #include "include/util.h" -#include "include/iosupport.h" #include "include/system.h" -#include "include/supportbase.h" #include "include/ioman.h" #include "modules/iopcore/common/cdvd_config.h" #include "include/cheatman.h" #include "include/pggsm.h" -#include "include/cheatman.h" #include "include/ps2cnf.h" #include "include/gui.h" diff --git a/src/system.c b/src/system.c index 4a95c5b69..1a727ce22 100644 --- a/src/system.c +++ b/src/system.c @@ -11,19 +11,16 @@ #include "include/opl.h" #include "include/gui.h" #include "include/ethsupport.h" -#include "include/hddsupport.h" #include "include/util.h" #include "include/pad.h" +#include "include/mcemu.h" #include "include/system.h" #include "include/ioman.h" #include "include/ioprp.h" -#include "include/bdmsupport.h" #include "include/OSDHistory.h" #include "include/renderman.h" #include "include/extern_irx.h" #include "../ee_core/include/modules.h" -#include "../ee_core/include/coreconfig.h" -#include #include "include/pggsm.h" #include "include/cheatman.h" #include "include/xparam.h" @@ -35,6 +32,12 @@ #define NEWLIB_PORT_AWARE #include // fileXioInit, fileXioExit, fileXioDevctl +#include +#include +#include +#include +#include + typedef struct { diff --git a/src/texcache.c b/src/texcache.c index 2648b2846..2fa32db46 100644 --- a/src/texcache.c +++ b/src/texcache.c @@ -3,7 +3,6 @@ #include "include/textures.h" #include "include/ioman.h" #include "include/gui.h" -#include "include/util.h" #include "include/renderman.h" typedef struct diff --git a/src/themes.c b/src/themes.c index 338dcb1c7..07494da06 100644 --- a/src/themes.c +++ b/src/themes.c @@ -3,20 +3,17 @@ #include "include/util.h" #include "include/gui.h" #include "include/renderman.h" -#include "include/textures.h" #include "include/ioman.h" #include "include/fntsys.h" #include "include/lang.h" #include "include/pad.h" #include "include/sound.h" +#include "include/imports.h" #define MENU_POS_V 50 #define HINT_HEIGHT 32 #define DECORATOR_SIZE 20 -extern const char conf_theme_OPL_cfg; -extern u16 size_conf_theme_OPL_cfg; - theme_t *gTheme; static int screenWidth; @@ -1273,7 +1270,7 @@ static void thmLoad(const char *themePath) if (!themePath) { // No theme specified. Prepare and load the default theme. themeConfig = configAlloc(0, NULL, NULL); - configReadBuffer(themeConfig, &conf_theme_OPL_cfg, size_conf_theme_OPL_cfg); + configReadBuffer(themeConfig, (const char *)&conf_theme_OPL_cfg, size_conf_theme_OPL_cfg); } else { snprintf(path, sizeof(path), "%sconf_theme.cfg", themePath); themeConfig = configAlloc(0, NULL, path); diff --git a/src/util.c b/src/util.c index 1a2d51edf..156bb09e3 100644 --- a/src/util.c +++ b/src/util.c @@ -8,12 +8,8 @@ #include "include/util.h" #include "include/ioman.h" #include "include/system.h" -#include -#include -#include -#include #include - +#include "include/imports.h" #include "include/hdd.h" #include "../modules/isofs/zso.h" @@ -21,11 +17,6 @@ extern int probed_fd; extern u32 probed_lba; -extern void *icon_sys; -extern int size_icon_sys; -extern void *icon_icn; -extern int size_icon_icn; - static int mcID = -1; void guiWarning(const char *text, int count); diff --git a/src/xparam.c b/src/xparam.c index a6524d538..ef2870fc6 100644 --- a/src/xparam.c +++ b/src/xparam.c @@ -8,6 +8,7 @@ #include "include/opl.h" #include "include/xparam.h" +#include char params_DCACHE_OFF[] = {'0', 'x', '1', '0', 0, '0', 0}; char params_CPU_DELAY[] = {'0', 'x', '6', 0, '0', 'x', '7', '8', '0', 0};