Skip to content

Commit

Permalink
fix extra ram on vita
Browse files Browse the repository at this point in the history
  • Loading branch information
JoseAaronLopezGarcia committed Jul 16, 2023
1 parent 664bd90 commit e8d1908
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 14 deletions.
2 changes: 1 addition & 1 deletion common/include/globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#define USER_SIZE (24 * 1024 * 1024)
#define KERNEL_SIZE (4 * 1024 * 1024)
#define VITA_FLASH_SIZE 0x01000000 // 16MiB
#define VITA_EXTRA_RAM_SIZE (16 * 1024 * 1024)
#define EXTRA_RAM_SIZE (32 * 1024 * 1024)
#define MAX_HIGH_MEMSIZE 55

// ARK_CONFIG
Expand Down
2 changes: 1 addition & 1 deletion core/compat/pentazemin/rebootex/patches.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ void SetMemoryPartitionTablePatched(void *sysmem_config, SceSysmemPartTable *tab
// Add flash0 ramfs as partition 11
SetMemoryPartitionTable(sysmem_config, table);
table->extVshell.addr = EXTRA_RAM;
table->extVshell.size = VITA_EXTRA_RAM_SIZE;
table->extVshell.size = VITA_FLASH_SIZE;
}

int PatchSysMem(void *a0, void *sysmem_config)
Expand Down
4 changes: 2 additions & 2 deletions core/compat/pentazemin/vitamem.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ void unlockVitaMemory(){
}


u32 kernel_size = 0; //VITA_EXTRA_RAM_SIZE - extra_user_ram; // p11 size
u32 user_size = USER_SIZE + VITA_EXTRA_RAM_SIZE; // new p2 size
u32 kernel_size = 0; // EXTRA_RAM_SIZE - extra_user_ram; // p11 size
u32 user_size = USER_SIZE + VITA_FLASH_SIZE; // new p2 size

// modify p2
partition = GetPartition(PSP_MEMORY_PARTITION_USER);
Expand Down
4 changes: 2 additions & 2 deletions core/compat/vita/rebootex/patches.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ void SetMemoryPartitionTablePatched(void *sysmem_config, SceSysmemPartTable *tab
{
// Add flash0 ramfs as partition 11
SetMemoryPartitionTable(sysmem_config, table);
table->extVshell.addr = 0x0B000000;
table->extVshell.size = (12*1024*1024);
table->extVshell.addr = EXTRA_RAM;
table->extVshell.size = EXTRA_RAM_SIZE;
}

int PatchSysMem(void *a0, void *sysmem_config)
Expand Down
26 changes: 19 additions & 7 deletions core/compat/vitapops/syspatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,20 +295,32 @@ int dummythread(int argc, void* argp){

int kermitSendRequestLog(void* a0, int a1, int a2, int a3, int a4, void* a5){

char tmp[64];
sprintf("mode: %d, cmd: %d\n", a1, a2);

int fd = sceIoOpen("ms0:/vitapops.log", PSP_O_WRONLY|PSP_O_APPEND|PSP_O_CREAT, 0777);
sceIoWrite(fd, tmp, strlen(tmp));
sceIoWrite(fd, "\n", 1);
sceIoClose(fd);
static volatile int logging = 0;
static char tmp[64];

//if (a1 == 9 && a2 == 1042) return 0;

if (!logging){
logging = 1;
sprintf(tmp, "mode: %d, cmd: %d\n", a1, a2);
int fd = sceIoOpen("ms0:/kermit.log", PSP_O_WRONLY|PSP_O_APPEND|PSP_O_CREAT, 0777);
sceIoWrite(fd, tmp, strlen(tmp));
sceIoClose(fd);
logging = 0;
}

return sceKermitSendRequest(a0, a1, a2, a3, a4, a5);
}

void ARKVitaPopsOnModuleStart(SceModule2 * mod){

static int booted = 0;

/*
if (strcmp(mod->modname, "sceIOFileManager") != 0 && strcmp(mod->modname, "sceKermitMsfs_driver") != 0){
hookImportByNID(mod, "sceKermit_driver", 0x36666181, kermitSendRequestLog);
}
*/

// Patch display in PSX exploits
if(strcmp(mod->modname, "sceDisplay_Service") == 0) {
Expand Down
2 changes: 1 addition & 1 deletion loader/live/kernel/psxloader/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ int exploitEntry(){
scanKernelFunctions(k_tbl);

// Extremely nasty solution to get screen working fine
k_tbl->KernelDelayThread(10000); // wait for system to finish booting up
k_tbl->KernelDelayThread(20000); // wait for system to finish booting up
loadstart_pops(); // load and start pops module
k_tbl->KernelDelayThread(1000000); // wait for pops to set up things
kill_pops(); // kill pops threads to prevent crash
Expand Down

0 comments on commit e8d1908

Please sign in to comment.