Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
JoseAaronLopezGarcia committed Sep 18, 2024
1 parent 88bb10e commit 9d0c4d0
Show file tree
Hide file tree
Showing 44 changed files with 76 additions and 62 deletions.
28 changes: 11 additions & 17 deletions common/include/ark.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@

#include <pspsdk.h>

#ifdef __cplusplus
extern "C" {
#endif

// Generic Offsets
#define USER_BASE 0x08800000
#define KERNEL_BASE 0x88000000
Expand Down Expand Up @@ -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{
Expand Down Expand Up @@ -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

2 changes: 1 addition & 1 deletion common/include/functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <sdk.h>
#include <psploadexec_kernel.h>
#include "module2.h"
#include "ark.h"
#include <ark.h>

struct minZipHeader {
char pk[2];
Expand Down
2 changes: 1 addition & 1 deletion common/include/rebootconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <systemctrl_se.h>
#include <functions.h>
#include "ansi_c_functions.h"
#include "ark.h"
#include <ark.h>

#define REBOOTEX_MAX_SIZE 0x5000
#define BTCNF_MAGIC 0x0F803001
Expand Down
23 changes: 18 additions & 5 deletions common/include/systemctrl.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,29 @@ extern "C"{
#include <pspiofilemgr_kernel.h>
#include <pspthreadman_kernel.h>
#include <psploadcore.h>
#include <ark.h>
#include <pspkernel.h>
#include <pspinit.h>
#include "module2.h"
#include <module2.h>

#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,
Expand Down Expand Up @@ -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));

Expand Down
2 changes: 1 addition & 1 deletion common/include/systemctrl_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ extern "C"{
#endif

#include "module2.h"
#include "ark.h"
#include <ark.h>

/*
* This File contains the required headers for exported, but internally used
Expand Down
2 changes: 1 addition & 1 deletion core/compat/pentazemin/vitamem.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <pspiofilemgr.h>
#include <stdio.h>
#include <string.h>
#include "ark.h"
#include <ark.h>
#include <systemctrl.h>
#include "sysmem.h"

Expand Down
2 changes: 1 addition & 1 deletion core/compat/psp/high_mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <pspiofilemgr.h>
#include <stdio.h>
#include <string.h>
#include "ark.h"
#include <ark.h>
#include <systemctrl.h>
#include "sysmem.h"

Expand Down
3 changes: 2 additions & 1 deletion core/compat/psp/libertas.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
#include <string.h>
#include <pspiofilemgr.h>
#include "libertas.h"
#include "ark.h"
#include <ark.h>
#include "macros.h"
#include <systemctrl.h>
#include "systemctrl_se.h"

extern int psp_model;
Expand Down
1 change: 1 addition & 0 deletions core/compat/psp/rebootex/patches.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "systemctrl.h"
#include "rebootex.h"
#include "pspbtcnf.h"

Expand Down
3 changes: 2 additions & 1 deletion core/compat/psp/region_free.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@
#include <psputilsforkernel.h>
#include <pspsysevent.h>
#include <pspiofilemgr.h>
#include <systemctrl.h>
#include <systemctrl_se.h>
#include <stdio.h>
#include <string.h>
#include "ark.h"
#include <ark.h>
#include "macros.h"
#include "module2.h"
#include "region_free.h"
Expand Down
2 changes: 1 addition & 1 deletion core/compat/vita/gameinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <rebootconfig.h>
#include <systemctrl.h>

#include "ark.h"
#include <ark.h>
#include "macros.h"
#include "module2.h"

Expand Down
2 changes: 1 addition & 1 deletion core/inferno/iodrv_funcs.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <pspthreadman_kernel.h>
#include "systemctrl_private.h"
#include "inferno.h"
#include "ark.h"
#include <ark.h>
#include "macros.h"

/*
Expand Down
2 changes: 1 addition & 1 deletion core/inferno/isocache.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <systemctrl.h>
#include <systemctrl_se.h>
#include "systemctrl_private.h"
#include "ark.h"
#include <ark.h>
#include "macros.h"

static u32 read_call = 0;
Expand Down
2 changes: 1 addition & 1 deletion core/inferno/isoread.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include "systemctrl_private.h"
#include "inferno.h"
#include "lz4.h"
#include "ark.h"
#include <ark.h>
#include "macros.h"

#define CSO_MAGIC 0x4F534943 // CISO
Expand Down
2 changes: 1 addition & 1 deletion core/inferno/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <pspinit.h>
#include "systemctrl_private.h"
#include "inferno.h"
#include "ark.h"
#include <ark.h>
#include "macros.h"

PSP_MODULE_INFO("PRO_Inferno_Driver", 0x1000, 2, 1);
Expand Down
2 changes: 1 addition & 1 deletion core/inferno/umd.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include <psprtc.h>
#include "systemctrl_private.h"
#include "inferno.h"
#include "ark.h"
#include <ark.h>
#include "macros.h"

extern int sceKernelGetCompiledSdkVersion(void);
Expand Down
2 changes: 1 addition & 1 deletion core/stargate/chn_iso.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include "systemctrl_private.h"
#include "kubridge.h"
#include "strsafe.h"
#include "ark.h"
#include <ark.h>
#include "macros.h"

typedef struct _pspMsPrivateDirent {
Expand Down
2 changes: 1 addition & 1 deletion core/systemctrl/src/gameinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <rebootconfig.h>
#include <systemctrl.h>

#include "ark.h"
#include <ark.h>
#include "macros.h"
#include "module2.h"

Expand Down
5 changes: 3 additions & 2 deletions core/systemctrl/src/leda.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include "ark.h"
#include "macros.h"
#include <ark.h>
#include <macros.h>
#include <systemctrl.h>


int leda_running = 0;
SceUID (* KernelLoadModuleMs2_hook)() = NULL;
SceUID (* KernelLoadModuleMs2_orig)() = NULL;
Expand Down
2 changes: 1 addition & 1 deletion core/vshctrl/custom_update.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include <string.h>
#include <systemctrl.h>
#include <systemctrl_se.h>
#include "ark.h"
#include <ark.h>
#include "macros.h"

extern ARKConfig* ark_config;
Expand Down
2 changes: 1 addition & 1 deletion core/vshctrl/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <systemctrl.h>
#include <systemctrl_se.h>
#include "macros.h"
#include "ark.h"
#include <ark.h>
#include "functions.h"

PSP_MODULE_INFO("VshCtrl", 0x1007, 1, 2);
Expand Down
2 changes: 1 addition & 1 deletion core/vshctrl/usbdevice.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include <stdio.h>
#include <string.h>

#include "ark.h"
#include <ark.h>
#include "macros.h"
#include <systemctrl.h>
#include <systemctrl_se.h>
Expand Down
2 changes: 1 addition & 1 deletion core/vshctrl/vshmenu.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <pspctrl.h>
#include <stdio.h>
#include <string.h>
#include "ark.h"
#include <ark.h>
#include <systemctrl.h>
#include <systemctrl_se.h>
#include "systemctrl_private.h"
Expand Down
2 changes: 1 addition & 1 deletion core/vshctrl/vshpatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include "virtual_pbp.h"
#include "macros.h"
#include "strsafe.h"
#include "ark.h"
#include <ark.h>

extern int _sceCtrlReadBufferPositive(SceCtrlData *ctrl, int count);
extern void patch_sceUSB_Driver(void);
Expand Down
2 changes: 1 addition & 1 deletion extras/apps/installer/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <stdio.h>
#include <systemctrl.h>
#include <systemctrl_se.h>
#include "ark.h"
#include <ark.h>
#include "macros.h"

PSP_MODULE_INFO("ARKInstaller", 0x800, 1, 0);
Expand Down
2 changes: 1 addition & 1 deletion extras/apps/updater/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <systemctrl.h>
#include <systemctrl_se.h>
#include <kubridge.h>
#include "ark.h"
#include <ark.h>

#include <tmctrl/tmctrl.h>
#include <msipl/mainbinex/payload.h>
Expand Down
1 change: 1 addition & 0 deletions extras/menus/recovery/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <pspctrl.h>
#include <systemctrl.h>
#include <systemctrl_se.h>
#include <ark.h>

#include <main.h>

Expand Down
2 changes: 1 addition & 1 deletion extras/menus/recovery/submenu.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <list.h>
#include <plugins.h>

#include "ark.h"
#include <ark.h>

extern ARKConfig* ark_config;
extern CFWConfig config;
Expand Down
2 changes: 1 addition & 1 deletion extras/menus/recovery/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <systemctrl_se.h>
#include <pspusb.h>
#include <pspusbstor.h>
#include "ark.h"
#include <ark.h>

#define PSP_USBSTOR_EF_DRIVERNAME "USBStorEFlash_Driver"

Expand Down
3 changes: 2 additions & 1 deletion extras/menus/vshmenu/include/vsh.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
#include <pspctrl.h>
#include <pspkernel.h>

#include "ark.h"
#include <ark.h>
#include <systemctrl.h>
#include <systemctrl_se.h>
#include "umdvideo_list.h"

Expand Down
2 changes: 1 addition & 1 deletion extras/modules/xmbctrl/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <kubridge.h>
#include <stddef.h>

#include "ark.h"
#include <ark.h>

#include "main.h"
#include "list.h"
Expand Down
2 changes: 1 addition & 1 deletion extras/modules/xmbctrl/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <systemctrl_se.h>
#include <stddef.h>

#include "ark.h"
#include <ark.h>
#include "macros.h"

#include "include/main.h"
Expand Down
2 changes: 1 addition & 1 deletion extras/modules/xmbctrl/plugins.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "ark.h"
#include <ark.h>

#include "list.h"
#include "settings.h"
Expand Down
2 changes: 1 addition & 1 deletion libs/libsploit/freemem.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <rebootconfig.h>
#include <systemctrl_se.h>
#include <string.h>
#include "ark.h"
#include <ark.h>
#include "functions.h"

// attempt to free as much memory as possible, some kernel/user exploits need this, others don't
Expand Down
2 changes: 1 addition & 1 deletion libs/libsploit/functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include <rebootconfig.h>
#include <systemctrl_se.h>
#include <string.h>
#include "ark.h"
#include <ark.h>
#include "functions.h"

static UserFunctions _g_tbl;
Expand Down
2 changes: 1 addition & 1 deletion libs/libsploit/imports.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <rebootconfig.h>
#include <systemctrl_se.h>
#include <string.h>
#include "ark.h"
#include <ark.h>
#include "functions.h"

void _flush_cache(){
Expand Down
Loading

0 comments on commit 9d0c4d0

Please sign in to comment.