From 9d0c4d016d48a3553a688d005b4de12c741e3772 Mon Sep 17 00:00:00 2001 From: JoseAaronLopezGarcia Date: Wed, 18 Sep 2024 11:28:52 +0200 Subject: [PATCH] cleanup --- common/include/ark.h | 28 ++++++++------------- common/include/functions.h | 2 +- common/include/rebootconfig.h | 2 +- common/include/systemctrl.h | 23 +++++++++++++---- common/include/systemctrl_private.h | 2 +- core/compat/pentazemin/vitamem.c | 2 +- core/compat/psp/high_mem.c | 2 +- core/compat/psp/libertas.c | 3 ++- core/compat/psp/rebootex/patches.c | 1 + core/compat/psp/region_free.c | 3 ++- core/compat/vita/gameinfo.c | 2 +- core/inferno/iodrv_funcs.c | 2 +- core/inferno/isocache.c | 2 +- core/inferno/isoread.c | 2 +- core/inferno/main.c | 2 +- core/inferno/umd.c | 2 +- core/stargate/chn_iso.c | 2 +- core/systemctrl/src/gameinfo.c | 2 +- core/systemctrl/src/leda.c | 5 ++-- core/vshctrl/custom_update.c | 2 +- core/vshctrl/main.c | 2 +- core/vshctrl/usbdevice.c | 2 +- core/vshctrl/vshmenu.c | 2 +- core/vshctrl/vshpatch.c | 2 +- extras/apps/installer/main.c | 2 +- extras/apps/updater/main.c | 2 +- extras/menus/recovery/main.c | 1 + extras/menus/recovery/submenu.c | 2 +- extras/menus/recovery/usb.c | 2 +- extras/menus/vshmenu/include/vsh.h | 3 ++- extras/modules/xmbctrl/config.c | 2 +- extras/modules/xmbctrl/main.c | 2 +- extras/modules/xmbctrl/plugins.c | 2 +- libs/libsploit/freemem.c | 2 +- libs/libsploit/functions.c | 2 +- libs/libsploit/imports.c | 2 +- libs/libsploit/patches.c | 2 +- libs/libsploit/scanner.c | 2 +- loader/dc/vunbricker/install.c | 1 + loader/live/kernel/chain_loader/main.c | 2 +- loader/live/kernel/kernel_loader/reboot.c | 2 +- loader/live/kernel/kxploit/sceUID/kxploit.c | 2 +- loader/live/user/psxloader/main.c | 2 +- loader/live/user/signed_eboot/eboot/main.c | 2 +- 44 files changed, 76 insertions(+), 62 deletions(-) diff --git a/common/include/ark.h b/common/include/ark.h index 7a36e76b8..6c6120e5f 100644 --- a/common/include/ark.h +++ b/common/include/ark.h @@ -20,6 +20,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + // Generic Offsets #define USER_BASE 0x08800000 #define KERNEL_BASE 0x88000000 @@ -105,23 +109,6 @@ typedef enum{ DEV_MASK = 0b1100, }ExecMode; -// Different PSP models -enum { - PSP_1000 = 0, // 01g - PSP_2000 = 1, // 02g - PSP_3000 = 2, // 03g - PSP_4000 = 3, // 04g - PSP_GO = 4, // 05g - PSP_7000 = 6, // 07g - PSP_9000 = 8, // 09g - PSP_11000 = 10, // 11g -}; - -// Different firmware versions -#define FW_661 0x06060110 -#define FW_660 0x06060010 -#define FW_150 0x01050003 - // These settings should be global and constant during the entire execution of ARK. // It should not be possible to change these (except for recovery flag). typedef struct ARKConfig{ @@ -151,5 +138,12 @@ typedef struct ARKConfig{ #define IS_VITA_ADR(ark_config) (ark_config->exec_mode==PSV_ADR) #define IS_VITA_POPS(ark_config) (ark_config->exec_mode==PSV_POPS) +// Get ARK's execution environment configuration +void* sctrlHENGetArkConfig(ARKConfig* conf); + +#ifdef __cplusplus +} +#endif + #endif diff --git a/common/include/functions.h b/common/include/functions.h index 2ca11bbac..0f48afeee 100644 --- a/common/include/functions.h +++ b/common/include/functions.h @@ -21,7 +21,7 @@ #include #include #include "module2.h" -#include "ark.h" +#include struct minZipHeader { char pk[2]; diff --git a/common/include/rebootconfig.h b/common/include/rebootconfig.h index b40c7cb92..a9583512b 100644 --- a/common/include/rebootconfig.h +++ b/common/include/rebootconfig.h @@ -23,7 +23,7 @@ #include #include #include "ansi_c_functions.h" -#include "ark.h" +#include #define REBOOTEX_MAX_SIZE 0x5000 #define BTCNF_MAGIC 0x0F803001 diff --git a/common/include/systemctrl.h b/common/include/systemctrl.h index 68271152a..bc4821319 100644 --- a/common/include/systemctrl.h +++ b/common/include/systemctrl.h @@ -27,13 +27,29 @@ extern "C"{ #include #include #include -#include #include #include -#include "module2.h" +#include #define GAME_ID_MINIMUM_BUFFER_SIZE 10 +// Different PSP models +enum { + PSP_1000 = 0, // 01g + PSP_2000 = 1, // 02g + PSP_3000 = 2, // 03g + PSP_4000 = 3, // 04g + PSP_GO = 4, // 05g + PSP_7000 = 6, // 07g + PSP_9000 = 8, // 09g + PSP_11000 = 10, // 11g +}; + +// Different firmware versions +#define FW_661 0x06060110 +#define FW_660 0x06060010 +#define FW_150 0x01050003 + enum BootLoadFlags { BOOTLOAD_VSH = 1, @@ -108,9 +124,6 @@ void flushCache(void); // Missing PSPSDK Functions u32 sceKernelQuerySystemCall(void * function); -// Get ARK's execution environment configuration -void* sctrlHENGetArkConfig(ARKConfig* conf); - // Register the default VRAM handler for PSX exploit, returns the previous handler void* sctrlHENSetPSXVramHandler(void (*handler)(u32* psp_vram, u16* ps1_vram)); diff --git a/common/include/systemctrl_private.h b/common/include/systemctrl_private.h index c00c0e78d..e8cb88c1f 100644 --- a/common/include/systemctrl_private.h +++ b/common/include/systemctrl_private.h @@ -23,7 +23,7 @@ extern "C"{ #endif #include "module2.h" -#include "ark.h" +#include /* * This File contains the required headers for exported, but internally used diff --git a/core/compat/pentazemin/vitamem.c b/core/compat/pentazemin/vitamem.c index dc33d23b9..5294c50a6 100644 --- a/core/compat/pentazemin/vitamem.c +++ b/core/compat/pentazemin/vitamem.c @@ -6,7 +6,7 @@ #include #include #include -#include "ark.h" +#include #include #include "sysmem.h" diff --git a/core/compat/psp/high_mem.c b/core/compat/psp/high_mem.c index 7752a25b2..1ddfa7774 100644 --- a/core/compat/psp/high_mem.c +++ b/core/compat/psp/high_mem.c @@ -23,7 +23,7 @@ #include #include #include -#include "ark.h" +#include #include #include "sysmem.h" diff --git a/core/compat/psp/libertas.c b/core/compat/psp/libertas.c index cd091493c..36d8d6e79 100644 --- a/core/compat/psp/libertas.c +++ b/core/compat/psp/libertas.c @@ -18,8 +18,9 @@ #include #include #include "libertas.h" -#include "ark.h" +#include #include "macros.h" +#include #include "systemctrl_se.h" extern int psp_model; diff --git a/core/compat/psp/rebootex/patches.c b/core/compat/psp/rebootex/patches.c index e49bbbb9e..0cdfda00d 100644 --- a/core/compat/psp/rebootex/patches.c +++ b/core/compat/psp/rebootex/patches.c @@ -1,3 +1,4 @@ +#include "systemctrl.h" #include "rebootex.h" #include "pspbtcnf.h" diff --git a/core/compat/psp/region_free.c b/core/compat/psp/region_free.c index 6c9b0a4a9..325a1391e 100644 --- a/core/compat/psp/region_free.c +++ b/core/compat/psp/region_free.c @@ -21,10 +21,11 @@ #include #include #include +#include #include #include #include -#include "ark.h" +#include #include "macros.h" #include "module2.h" #include "region_free.h" diff --git a/core/compat/vita/gameinfo.c b/core/compat/vita/gameinfo.c index c7ec0a893..381359306 100644 --- a/core/compat/vita/gameinfo.c +++ b/core/compat/vita/gameinfo.c @@ -5,7 +5,7 @@ #include #include -#include "ark.h" +#include #include "macros.h" #include "module2.h" diff --git a/core/inferno/iodrv_funcs.c b/core/inferno/iodrv_funcs.c index bd66eb611..6bb0674fd 100644 --- a/core/inferno/iodrv_funcs.c +++ b/core/inferno/iodrv_funcs.c @@ -28,7 +28,7 @@ #include #include "systemctrl_private.h" #include "inferno.h" -#include "ark.h" +#include #include "macros.h" /* diff --git a/core/inferno/isocache.c b/core/inferno/isocache.c index 9cb301436..bbecea436 100644 --- a/core/inferno/isocache.c +++ b/core/inferno/isocache.c @@ -10,7 +10,7 @@ #include #include #include "systemctrl_private.h" -#include "ark.h" +#include #include "macros.h" static u32 read_call = 0; diff --git a/core/inferno/isoread.c b/core/inferno/isoread.c index 2fa3f8ad6..8520698f7 100644 --- a/core/inferno/isoread.c +++ b/core/inferno/isoread.c @@ -28,7 +28,7 @@ #include "systemctrl_private.h" #include "inferno.h" #include "lz4.h" -#include "ark.h" +#include #include "macros.h" #define CSO_MAGIC 0x4F534943 // CISO diff --git a/core/inferno/main.c b/core/inferno/main.c index b1686f110..55057571b 100644 --- a/core/inferno/main.c +++ b/core/inferno/main.c @@ -28,7 +28,7 @@ #include #include "systemctrl_private.h" #include "inferno.h" -#include "ark.h" +#include #include "macros.h" PSP_MODULE_INFO("PRO_Inferno_Driver", 0x1000, 2, 1); diff --git a/core/inferno/umd.c b/core/inferno/umd.c index 098c011ef..836464766 100644 --- a/core/inferno/umd.c +++ b/core/inferno/umd.c @@ -27,7 +27,7 @@ #include #include "systemctrl_private.h" #include "inferno.h" -#include "ark.h" +#include #include "macros.h" extern int sceKernelGetCompiledSdkVersion(void); diff --git a/core/stargate/chn_iso.c b/core/stargate/chn_iso.c index 2502d3e31..a9d201443 100644 --- a/core/stargate/chn_iso.c +++ b/core/stargate/chn_iso.c @@ -29,7 +29,7 @@ #include "systemctrl_private.h" #include "kubridge.h" #include "strsafe.h" -#include "ark.h" +#include #include "macros.h" typedef struct _pspMsPrivateDirent { diff --git a/core/systemctrl/src/gameinfo.c b/core/systemctrl/src/gameinfo.c index 8d77a4ac3..d81b25871 100644 --- a/core/systemctrl/src/gameinfo.c +++ b/core/systemctrl/src/gameinfo.c @@ -5,7 +5,7 @@ #include #include -#include "ark.h" +#include #include "macros.h" #include "module2.h" diff --git a/core/systemctrl/src/leda.c b/core/systemctrl/src/leda.c index 8937c3aa6..3fa18570a 100644 --- a/core/systemctrl/src/leda.c +++ b/core/systemctrl/src/leda.c @@ -7,10 +7,11 @@ #include #include #include -#include "ark.h" -#include "macros.h" +#include +#include #include + int leda_running = 0; SceUID (* KernelLoadModuleMs2_hook)() = NULL; SceUID (* KernelLoadModuleMs2_orig)() = NULL; diff --git a/core/vshctrl/custom_update.c b/core/vshctrl/custom_update.c index d45c3bccb..e4e560ca4 100644 --- a/core/vshctrl/custom_update.c +++ b/core/vshctrl/custom_update.c @@ -26,7 +26,7 @@ #include #include #include -#include "ark.h" +#include #include "macros.h" extern ARKConfig* ark_config; diff --git a/core/vshctrl/main.c b/core/vshctrl/main.c index 2c16d9277..34e863b44 100644 --- a/core/vshctrl/main.c +++ b/core/vshctrl/main.c @@ -28,7 +28,7 @@ #include #include #include "macros.h" -#include "ark.h" +#include #include "functions.h" PSP_MODULE_INFO("VshCtrl", 0x1007, 1, 2); diff --git a/core/vshctrl/usbdevice.c b/core/vshctrl/usbdevice.c index eb4f1c32b..72e915999 100644 --- a/core/vshctrl/usbdevice.c +++ b/core/vshctrl/usbdevice.c @@ -26,7 +26,7 @@ #include #include -#include "ark.h" +#include #include "macros.h" #include #include diff --git a/core/vshctrl/vshmenu.c b/core/vshctrl/vshmenu.c index dc0ae77f0..6ab6f564b 100644 --- a/core/vshctrl/vshmenu.c +++ b/core/vshctrl/vshmenu.c @@ -24,7 +24,7 @@ #include #include #include -#include "ark.h" +#include #include #include #include "systemctrl_private.h" diff --git a/core/vshctrl/vshpatch.c b/core/vshctrl/vshpatch.c index 93bc60533..e4ce9f480 100644 --- a/core/vshctrl/vshpatch.c +++ b/core/vshctrl/vshpatch.c @@ -33,7 +33,7 @@ #include "virtual_pbp.h" #include "macros.h" #include "strsafe.h" -#include "ark.h" +#include extern int _sceCtrlReadBufferPositive(SceCtrlData *ctrl, int count); extern void patch_sceUSB_Driver(void); diff --git a/extras/apps/installer/main.c b/extras/apps/installer/main.c index 02770c8c9..63b7cd46d 100644 --- a/extras/apps/installer/main.c +++ b/extras/apps/installer/main.c @@ -8,7 +8,7 @@ #include #include #include -#include "ark.h" +#include #include "macros.h" PSP_MODULE_INFO("ARKInstaller", 0x800, 1, 0); diff --git a/extras/apps/updater/main.c b/extras/apps/updater/main.c index 107a45599..dcb6c2af7 100644 --- a/extras/apps/updater/main.c +++ b/extras/apps/updater/main.c @@ -10,7 +10,7 @@ #include #include #include -#include "ark.h" +#include #include #include diff --git a/extras/menus/recovery/main.c b/extras/menus/recovery/main.c index 75b097512..3f4ebbb27 100644 --- a/extras/menus/recovery/main.c +++ b/extras/menus/recovery/main.c @@ -4,6 +4,7 @@ #include #include #include +#include #include diff --git a/extras/menus/recovery/submenu.c b/extras/menus/recovery/submenu.c index 981d056e2..dea561a25 100644 --- a/extras/menus/recovery/submenu.c +++ b/extras/menus/recovery/submenu.c @@ -9,7 +9,7 @@ #include #include -#include "ark.h" +#include extern ARKConfig* ark_config; extern CFWConfig config; diff --git a/extras/menus/recovery/usb.c b/extras/menus/recovery/usb.c index f6ac4f0be..cc8c9473c 100644 --- a/extras/menus/recovery/usb.c +++ b/extras/menus/recovery/usb.c @@ -3,7 +3,7 @@ #include #include #include -#include "ark.h" +#include #define PSP_USBSTOR_EF_DRIVERNAME "USBStorEFlash_Driver" diff --git a/extras/menus/vshmenu/include/vsh.h b/extras/menus/vshmenu/include/vsh.h index 898d826f9..6ba8a8292 100644 --- a/extras/menus/vshmenu/include/vsh.h +++ b/extras/menus/vshmenu/include/vsh.h @@ -6,7 +6,8 @@ #include #include -#include "ark.h" +#include +#include #include #include "umdvideo_list.h" diff --git a/extras/modules/xmbctrl/config.c b/extras/modules/xmbctrl/config.c index e26bf1b80..bfa078750 100644 --- a/extras/modules/xmbctrl/config.c +++ b/extras/modules/xmbctrl/config.c @@ -5,7 +5,7 @@ #include #include -#include "ark.h" +#include #include "main.h" #include "list.h" diff --git a/extras/modules/xmbctrl/main.c b/extras/modules/xmbctrl/main.c index 8ab333365..d683e5a25 100644 --- a/extras/modules/xmbctrl/main.c +++ b/extras/modules/xmbctrl/main.c @@ -28,7 +28,7 @@ #include #include -#include "ark.h" +#include #include "macros.h" #include "include/main.h" diff --git a/extras/modules/xmbctrl/plugins.c b/extras/modules/xmbctrl/plugins.c index b1f7c276a..68e8b73d2 100644 --- a/extras/modules/xmbctrl/plugins.c +++ b/extras/modules/xmbctrl/plugins.c @@ -1,4 +1,4 @@ -#include "ark.h" +#include #include "list.h" #include "settings.h" diff --git a/libs/libsploit/freemem.c b/libs/libsploit/freemem.c index bfb0bb93a..7aad38aea 100644 --- a/libs/libsploit/freemem.c +++ b/libs/libsploit/freemem.c @@ -10,7 +10,7 @@ #include #include #include -#include "ark.h" +#include #include "functions.h" // attempt to free as much memory as possible, some kernel/user exploits need this, others don't diff --git a/libs/libsploit/functions.c b/libs/libsploit/functions.c index b19d5ed14..dab8c7e7f 100644 --- a/libs/libsploit/functions.c +++ b/libs/libsploit/functions.c @@ -27,7 +27,7 @@ #include #include #include -#include "ark.h" +#include #include "functions.h" static UserFunctions _g_tbl; diff --git a/libs/libsploit/imports.c b/libs/libsploit/imports.c index a927bca96..e426ebc75 100644 --- a/libs/libsploit/imports.c +++ b/libs/libsploit/imports.c @@ -10,7 +10,7 @@ #include #include #include -#include "ark.h" +#include #include "functions.h" void _flush_cache(){ diff --git a/libs/libsploit/patches.c b/libs/libsploit/patches.c index 6bd90ea83..05e3de8b6 100644 --- a/libs/libsploit/patches.c +++ b/libs/libsploit/patches.c @@ -10,7 +10,7 @@ #include #include #include -#include "ark.h" +#include #include "functions.h" u32 _findJAL(u32 addr, int reversed, int skip){ diff --git a/libs/libsploit/scanner.c b/libs/libsploit/scanner.c index 68b307b53..892281d07 100644 --- a/libs/libsploit/scanner.c +++ b/libs/libsploit/scanner.c @@ -10,7 +10,7 @@ #include #include #include -#include "ark.h" +#include #include "functions.h" // counter for relocated stubs diff --git a/loader/dc/vunbricker/install.c b/loader/dc/vunbricker/install.c index 2d24d15d4..a519380c6 100644 --- a/loader/dc/vunbricker/install.c +++ b/loader/dc/vunbricker/install.c @@ -21,6 +21,7 @@ #include #include +#include #include "dcman.h" #include "main.h" #include "install.h" diff --git a/loader/live/kernel/chain_loader/main.c b/loader/live/kernel/chain_loader/main.c index ffc14d271..10b246e76 100644 --- a/loader/live/kernel/chain_loader/main.c +++ b/loader/live/kernel/chain_loader/main.c @@ -18,7 +18,7 @@ #include #include #include "graphics.h" -#include "ark.h" +#include #include "functions.h" #define ARK_LOADADDR 0x08D30000 diff --git a/loader/live/kernel/kernel_loader/reboot.c b/loader/live/kernel/kernel_loader/reboot.c index 26c90a77a..313768971 100644 --- a/loader/live/kernel/kernel_loader/reboot.c +++ b/loader/live/kernel/kernel_loader/reboot.c @@ -16,7 +16,7 @@ */ #include "reboot.h" -#include "ark.h" +#include #include "main.h" u8* rebootbuffer = NULL; diff --git a/loader/live/kernel/kxploit/sceUID/kxploit.c b/loader/live/kernel/kxploit/sceUID/kxploit.c index 2298867e8..9a318b7e3 100644 --- a/loader/live/kernel/kxploit/sceUID/kxploit.c +++ b/loader/live/kernel/kxploit/sceUID/kxploit.c @@ -21,7 +21,7 @@ Made to work on OFW and CFW. #include #include "macros.h" -#include "ark.h" +#include #include "functions.h" #include "kxploit.h" diff --git a/loader/live/user/psxloader/main.c b/loader/live/user/psxloader/main.c index 0078821d9..99722a674 100644 --- a/loader/live/user/psxloader/main.c +++ b/loader/live/user/psxloader/main.c @@ -13,7 +13,7 @@ #include #include -#include "ark.h" +#include PSP_MODULE_INFO("ARK VitaPOPS Loader", 0, 1, 0); diff --git a/loader/live/user/signed_eboot/eboot/main.c b/loader/live/user/signed_eboot/eboot/main.c index 2baa654de..6416e1c98 100644 --- a/loader/live/user/signed_eboot/eboot/main.c +++ b/loader/live/user/signed_eboot/eboot/main.c @@ -14,7 +14,7 @@ #include #include -#include "ark.h" +#include #include "rebootconfig.h" #include "functions.h" #include "graphics.h"