[SOLVED] sctrlKernelLoadExecVSHMs4() usage?

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
Turulo
Posts: 2
Joined: Fri Jan 18, 2008 3:39 am
Contact:

[SOLVED] sctrlKernelLoadExecVSHMs4() usage?

Post by Turulo »

Hi,

I'm trying to load some POPs from a hombrew without success. I keep getting 8002014E error...

This is the code which im using.

main.c:

Code: Select all

#include <stdio.h>
#include "systemctrl.h"

PSP_MODULE_INFO&#40;"usbpops", 0x1000, 1, 1&#41;;


int test_thread&#40;SceSize args, void *argp&#41;
&#123;
   char file&#91;256&#93;;

   strcpy&#40;file, "ms0&#58;/psp/game/sles01760/eboot.pbp"&#41;;

   struct SceKernelLoadExecVSHParam param;

   memset&#40;&param, 0, sizeof&#40;param&#41;&#41;;

   param.key = "game";
   param.size = sizeof&#40;param&#41;;
   param.args = strlen&#40;file&#41;+1;
   param.argp = file;

   sctrlKernelLoadExecVSHMs4&#40;file, &param&#41;;
   //sctrlKernelLoadExecVSHMs4&#40;file, NULL&#41;;

   sceKernelExitDeleteThread&#40;0&#41;;

   return 0;
&#125;

int module_start&#40;SceSize args, void *argp&#41;
&#123;

   int thid = sceKernelCreateThread&#40;"loadExecVSHMs4Thread", test_thread, 14, 0x3000, 0, NULL&#41;;
   if&#40;thid >= 0&#41; sceKernelStartThread&#40;thid, args, argp&#41;;

   sceKernelExitDeleteThread&#40;0&#41;;

   return 0;
&#125;
Makefile:

Code: Select all

TARGET = usbpops
OBJS = main.o

# Define to build this as a prx &#40;instead of a static elf&#41;
#PRX_EXPORTS=exports.exp
BUILD_PRX=1
#PSP_FW_VERSION = 371
# Define the name of our custom exports &#40;minus the .exp extension&#41;

USE_KERNEL_LIBC=1
USE_KERNEL_LIBS=1

CFLAGS = -Os -G0 -Wall -fno-strict-aliasing -fno-builtin-printf
CXXFLAGS = $&#40;CFLAGS&#41; -fno-exceptions -fno-rtti
ASFLAGS = $&#40;CFLAGS&#41;

INCDIR = include
LIBDIR = lib
LDFLAGS = -mno-crt0 -nostartfiles
LIBS = -lpspsystemctrl_kernel

EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = usbpops

PSPSDK=$&#40;shell psp-config --pspsdk-path&#41;
include $&#40;PSPSDK&#41;/lib/build.mak
I don't know what I'm doing wrong, as the sctrlKernelLoadExecVSHMs4 isn't documented anywhere...

Using that code, if i call sctrlKernelLoadExecVSHMs2() to load a standard homebrew works fine, but not for a PSX EBOOT using sctrlKernelLoadExecVSHMs4().

Any hints?
Turulo
Posts: 2
Joined: Fri Jan 18, 2008 3:39 am
Contact:

Post by Turulo »

After looking strings from some others people .prx to load pops i found they use the key "pops" for SceKernelLoadExecVSHParam structure.

Also there is a strange behavior white the filename string... the "eboot.pbp" string must be uppercase, otherwise it wont load...

Here is a working code

Code: Select all

#include <stdio.h>
#include "systemctrl.h"

PSP_MODULE_INFO&#40;"usbpops", 0x1000, 1, 1&#41;;


int test_thread&#40;SceSize args, void *argp&#41;
&#123;
   char file&#91;256&#93;;

   strcpy&#40;file, "ms0&#58;/psp/game/sles01760/EBOOT.PBP"&#41;;

   struct SceKernelLoadExecVSHParam param;

   memset&#40;&param, 0, sizeof&#40;param&#41;&#41;;

   param.key = "pops";
   param.size = sizeof&#40;param&#41;;
   param.args = strlen&#40;file&#41;+1;
   param.argp = file;

   sctrlKernelLoadExecVSHMs4&#40;file, &param&#41;;
   //sctrlKernelLoadExecVSHMs4&#40;file, NULL&#41;;

   sceKernelExitDeleteThread&#40;0&#41;;

   return 0;
&#125;

int module_start&#40;SceSize args, void *argp&#41;
&#123;

   int thid = sceKernelCreateThread&#40;"loadExecVSHMs4Thread", test_thread, 14, 0x3000, 0, NULL&#41;;
   if&#40;thid >= 0&#41; sceKernelStartThread&#40;thid, args, argp&#41;;

   sceKernelExitDeleteThread&#40;0&#41;;

   return 0;
&#125;
FreePlay
Posts: 71
Joined: Wed Jan 04, 2006 6:53 pm
Location: Schenectady, New York, USA

Post by FreePlay »

Yeah, I'm pretty sure discussion of this sort of thing isn't exactly kosher here.
Post Reply