Skip to content
Permalink
Browse files

Moved Adrenaline location to ur0: and increased path buffer length in…

… vshctrl
  • Loading branch information...
TheOfficialFloW committed Aug 2, 2017
1 parent f498992 commit f4c394f8f70fa8b4d50d26df1b93edcb968d38b3
Showing with 43 additions and 47 deletions.
  1. +1 −1 cef/recovery/installer.c
  2. +13 −13 cef/vshctrl/main.c
  3. +1 −1 kernel/utils.c
  4. +13 −13 user/main.c
  5. +6 −3 user/main.h
  6. +2 −11 user/menu.c
  7. +1 −1 user/msfs.c
  8. +6 −4 user/utils.c
@@ -141,7 +141,7 @@ void Installer() {
// Open file
SceUID fd = sceIoOpen("ms0:/__ADRENALINE__/661.PBP", PSP_O_RDONLY, 0);
if (fd < 0) {
printf("Cannot find ux0:adrenaline/661.PBP.\n");
printf("Cannot find ur0:adrenaline/661.PBP.\n");
goto EXIT;
}

@@ -30,7 +30,7 @@ PSP_MODULE_INFO("VshControl", 0x1007, 1, 0);

#define DUMMY_CAT_ISO_EXTENSION " "

char categorypath[256];
char categorypath[512];
SceUID categorydfd = -1;

SceUID gamedfd = -1, isodfd = -1, overiso = 0;
@@ -56,7 +56,7 @@ void KXploitString(char *str) {
}

int CorruptIconPatch(char *name) {
char path[256];
char path[512];
sprintf(path, "ms0:/PSP/GAME/%s%%/EBOOT.PBP", name);

SceIoStat stat;
@@ -70,7 +70,7 @@ int CorruptIconPatch(char *name) {
}

int HideDlc(char *name) {
char path[256];
char path[512];
sprintf(path, "ms0:/PSP/GAME/%s/PARAM.PBP", name);

SceIoStat stat;
@@ -89,7 +89,7 @@ int HideDlc(char *name) {
}

int HideAdrenaline(char *name) {
char path[256];
char path[512];
sprintf(path, "ms0:/PSP/GAME/%s/EBOOT.PBP", name);

SceIoStat stat;
@@ -234,9 +234,9 @@ int ReadCache() {
int i;

if (!cache)
cache = (VirtualPbp *)oe_malloc(32 * sizeof(VirtualPbp));
cache = (VirtualPbp *)oe_malloc(128 * sizeof(VirtualPbp));

memset(cache, 0, sizeof(VirtualPbp) * 32);
memset(cache, 0, sizeof(VirtualPbp) * 128);

for (i = 0; i < 0x10; i++) {
fd = sceIoOpen("ms0:/PSP/SYSTEM/isocaches.bin", PSP_O_RDONLY, 0);
@@ -247,7 +247,7 @@ int ReadCache() {
if (i == 0x10)
return -1;

sceIoRead(fd, cache, sizeof(VirtualPbp) * 32);
sceIoRead(fd, cache, sizeof(VirtualPbp) * 128);
sceIoClose(fd);

return 0;
@@ -260,7 +260,7 @@ int SaveCache() {
if (!cache)
return -1;

for (i = 0; i < 32; i++) {
for (i = 0; i < 128; i++) {
if (cache[i].isofile[0] != 0) {
SceIoStat stat;
memset(&stat, 0, sizeof(stat));
@@ -288,15 +288,15 @@ int SaveCache() {
if (i == 0x10)
return -1;

sceIoWrite(fd, cache, sizeof(VirtualPbp) * 32);
sceIoWrite(fd, cache, sizeof(VirtualPbp) * 128);
sceIoClose(fd);

return 0;
}

int IsCached(char *isofile, ScePspDateTime *mtime, VirtualPbp *res) {
int i;
for (i = 0; i < 32; i++) {
for (i = 0; i < 128; i++) {
if (cache[i].isofile[0] != 0) {
if (strcmp(cache[i].isofile, isofile) == 0) {
if (memcmp(mtime, &cache[i].mtime, sizeof(ScePspDateTime)) == 0) {
@@ -312,7 +312,7 @@ int IsCached(char *isofile, ScePspDateTime *mtime, VirtualPbp *res) {

int Cache(VirtualPbp *pbp) {
int i;
for (i = 0; i < 32; i++) {
for (i = 0; i < 128; i++) {
if (cache[i].isofile[0] == 0) {
memcpy(&cache[i], pbp, sizeof(VirtualPbp));
cachechanged = 1;
@@ -330,7 +330,7 @@ int AddIsoDirent(char *path, SceUID fd, SceIoDirent *dir, int readcategories) {

NEXT:
if ((res = sceIoDread(fd, dir)) > 0) {
char fullpath[128];
char fullpath[512];
int res2 = -1;
int docache;

@@ -363,7 +363,7 @@ int AddIsoDirent(char *path, SceUID fd, SceIoDirent *dir, int readcategories) {
}
}
} else {
if (readcategories && dir->d_name[0] != '.') {
if (readcategories && dir->d_name[0] != '.' && strcmp(dir->d_name, "VIDEO") != 0) {
strcat(dir->d_name, DUMMY_CAT_ISO_EXTENSION);
} else {
goto NEXT;
@@ -24,7 +24,7 @@
#include <string.h>

void debug_printf(char *msg) {
SceUID fd = ksceIoOpen("ux0:adrenaline_kernel_log.txt", SCE_O_WRONLY | SCE_O_CREAT | SCE_O_APPEND, 0777);
SceUID fd = ksceIoOpen("ur0:adrenaline/kernel_log.txt", SCE_O_WRONLY | SCE_O_CREAT | SCE_O_APPEND, 0777);
if (fd >= 0) {
ksceIoWrite(fd, msg, strlen(msg));
ksceIoClose(fd);
@@ -106,16 +106,16 @@ AdrenalineConfig config;
extern int menu_open;

void GetFunctions() {
ScePspemuDivide = (void *)(text_addr + 0x39F0 + 0x1);
ScePspemuErrorExit = (void *)(text_addr + 0x4104 + 0x1);
ScePspemuConvertAddress = (void *)(text_addr + 0x6364 + 0x1);
ScePspemuWritebackCache = (void *)(text_addr + 0x6490 + 0x1);
ScePspemuKermitWaitAndGetRequest = (void *)(text_addr + 0x64D0 + 0x1);
ScePspemuKermitSendResponse = (void *)(text_addr + 0x6560 + 0x1);
ScePspemuConvertStatTimeToUtc = (void *)(text_addr + 0x8664 + 0x1);
ScePspemuConvertStatTimeToLocaltime = (void *)(text_addr + 0x8680 + 0x1);
ScePspemuSetDisplayConfig = (void *)(text_addr + 0x20E50 + 0x1);
ScePspemuPausePops = (void *)(text_addr + 0x300C0 + 0x1);
ScePspemuDivide = (void *)(text_addr + 0x39F0 + 0x1);
ScePspemuErrorExit = (void *)(text_addr + 0x4104 + 0x1);
ScePspemuConvertAddress = (void *)(text_addr + 0x6364 + 0x1);
ScePspemuWritebackCache = (void *)(text_addr + 0x6490 + 0x1);
ScePspemuKermitWaitAndGetRequest = (void *)(text_addr + 0x64D0 + 0x1);
ScePspemuKermitSendResponse = (void *)(text_addr + 0x6560 + 0x1);
ScePspemuConvertStatTimeToUtc = (void *)(text_addr + 0x8664 + 0x1);
ScePspemuConvertStatTimeToLocaltime = (void *)(text_addr + 0x8680 + 0x1);
ScePspemuSetDisplayConfig = (void *)(text_addr + 0x20E50 + 0x1);
ScePspemuPausePops = (void *)(text_addr + 0x300C0 + 0x1);
}

void SendAdrenalineRequest(int cmd) {
@@ -271,7 +271,7 @@ int AdrenalineCompat(SceSize args, void *argp) {
sceIoClose(fd);
}

usbdevice_modid = startUsb("ux0:adrenaline/usbdevice.skprx", path, SCE_USBSTOR_VSTOR_TYPE_FAT);
usbdevice_modid = startUsb("ur0:adrenaline/usbdevice.skprx", path, SCE_USBSTOR_VSTOR_TYPE_FAT);

// Response
res = (usbdevice_modid < 0) ? usbdevice_modid : 0;
@@ -466,7 +466,7 @@ static int sceCompatWaitSpecialRequestPatched(int mode) {

SceIoStat stat;
memset(&stat, 0, sizeof(SceIoStat));
if (sceIoGetstat("ux0:adrenaline/flash0", &stat) < 0)
if (sceIoGetstat("ur0:adrenaline/flash0", &stat) < 0)
((uint32_t *)n)[0] = 4; // Recovery mode

ScePspemuWritebackCache(n, 0x100);
@@ -826,7 +826,7 @@ int module_start(SceSize args, void *argp) {

// Read config
memset(&config, 0, sizeof(AdrenalineConfig));
ReadFile("ux0:adrenaline/adrenaline.bin", &config, sizeof(AdrenalineConfig));
ReadFile("ur0:adrenaline/adrenaline.bin", &config, sizeof(AdrenalineConfig));

// Use ux0 if imc0 is unavailable
if (config.ms_location == MEMORY_STICK_LOCATION_IMC0 && !hasImc0())
@@ -32,9 +32,12 @@
#define ADRENALINE_CFG_MAGIC_1 0x31483943
#define ADRENALINE_CFG_MAGIC_2 0x334F4E33

#define MEMORY_STICK_LOCATION_UX0 0
#define MEMORY_STICK_LOCATION_UR0 1
#define MEMORY_STICK_LOCATION_IMC0 2
enum MemoryStickLocations {
MEMORY_STICK_LOCATION_UX0,
MEMORY_STICK_LOCATION_UR0,
MEMORY_STICK_LOCATION_IMC0,
MEMORY_STICK_LOCATION_UMA0,
};

enum AdrenalineScreenSizes {
SCREEN_SIZE_2_00,
@@ -69,7 +69,7 @@ static char *screen_mode_options[] = { "Original", "Normal", "Zoom", "Full" };
static char *no_yes_options[] = { "No", "Yes" };
static char *yes_no_options[] = { "Yes", "No" };
static char *screen_size_options[] = { "2.0x", "1.75x", "1.5x", "1.25x", "1.0x" };
static char *ms_location_options[] = { "ux0:pspemu", "ur0:pspemu", "imc0:pspemu" };
static char *ms_location_options[] = { "ux0:pspemu", "ur0:pspemu", "imc0:pspemu", "uma0:pspemu" };

static MenuEntry main_entries[] = {
{ "Enter Standby Mode", MENU_ENTRY_TYPE_CALLBACK, 0, EnterStandbyMode, NULL, NULL, 0 },
@@ -151,23 +151,14 @@ static int EnterAdrenalineMenu() {
if (adrenaline->pops_mode)
ScePspemuPausePops(1);

int i;
for (i = 0; i < sizeof(settings_entries) / sizeof(MenuEntry); i++)
{
if (settings_entries[i].options == ms_location_options && !hasImc0()) {
settings_entries[i].n_options = sizeof(ms_location_options) / sizeof(char **) - 1;
break;
}
}

return 0;
}

int ExitAdrenalineMenu() {
if (changed) {
config.magic[0] = ADRENALINE_CFG_MAGIC_1;
config.magic[1] = ADRENALINE_CFG_MAGIC_2;
WriteFile("ux0:adrenaline/adrenaline.bin", &config, sizeof(AdrenalineConfig));
WriteFile("ur0:adrenaline/adrenaline.bin", &config, sizeof(AdrenalineConfig));
}

SceAdrenaline *adrenaline = (SceAdrenaline *)ScePspemuConvertAddress(ADRENALINE_ADDRESS, SCE_COMPAT_CACHE_NONE, ADRENALINE_SIZE);
@@ -37,7 +37,7 @@ static void buildPspemuMsfsPath(char *out_path, const char *in_path) {
in_path++;

if (strncmp(in_path, "__ADRENALINE__", 14) == 0) {
snprintf(out_path, MAX_PATH_LENGTH, "ux0:adrenaline%s", in_path+14);
snprintf(out_path, MAX_PATH_LENGTH, "ur0:adrenaline%s", in_path+14);
} else {
snprintf(out_path, MAX_PATH_LENGTH, "%s/%s", getPspemuMemoryStickLocation(), in_path);
}
@@ -58,7 +58,7 @@ int debugPrintf(char *text, ...) {
vsprintf(string, text, list);
va_end(list);

SceUID fd = sceIoOpen("ux0:adrenaline_log.txt", SCE_O_WRONLY | SCE_O_CREAT | SCE_O_APPEND, 0777);
SceUID fd = sceIoOpen("ur0:adrenaline/user_log.txt", SCE_O_WRONLY | SCE_O_CREAT | SCE_O_APPEND, 0777);
if (fd >= 0) {
sceIoWrite(fd, string, strlen(string));
sceIoClose(fd);
@@ -202,12 +202,14 @@ void SetPspemuFrameBuffer(void *base) {

char *getPspemuMemoryStickLocation() {
switch (config.ms_location) {
case MEMORY_STICK_LOCATION_UX0:
return "ux0:pspemu";
case MEMORY_STICK_LOCATION_UR0:
return "ur0:pspemu";
default:
case MEMORY_STICK_LOCATION_IMC0:
return "imc0:pspemu";
case MEMORY_STICK_LOCATION_UMA0:
return "uma0:pspemu";
default:
return "ux0:pspemu";
}
}

0 comments on commit f4c394f

Please sign in to comment.
You can’t perform that action at this time.