forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[SOLVED] sctrlKernelLoadExecVSHMs4() usage?

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
Turulo



Joined: 18 Jan 2008
Posts: 2

PostPosted: Fri Jan 18, 2008 3:48 am    Post subject: [SOLVED] sctrlKernelLoadExecVSHMs4() usage? Reply with quote

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:
#include <stdio.h>
#include "systemctrl.h"

PSP_MODULE_INFO("usbpops", 0x1000, 1, 1);


int test_thread(SceSize args, void *argp)
{
   char file[256];

   strcpy(file, "ms0:/psp/game/sles01760/eboot.pbp");

   struct SceKernelLoadExecVSHParam param;

   memset(&param, 0, sizeof(param));

   param.key = "game";
   param.size = sizeof(param);
   param.args = strlen(file)+1;
   param.argp = file;

   sctrlKernelLoadExecVSHMs4(file, &param);
   //sctrlKernelLoadExecVSHMs4(file, NULL);

   sceKernelExitDeleteThread(0);

   return 0;
}

int module_start(SceSize args, void *argp)
{

   int thid = sceKernelCreateThread("loadExecVSHMs4Thread", test_thread, 14, 0x3000, 0, NULL);
   if(thid >= 0) sceKernelStartThread(thid, args, argp);

   sceKernelExitDeleteThread(0);

   return 0;
}


Makefile:
Code:
TARGET = usbpops
OBJS = main.o

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

USE_KERNEL_LIBC=1
USE_KERNEL_LIBS=1

CFLAGS = -Os -G0 -Wall -fno-strict-aliasing -fno-builtin-printf
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)

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

EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = usbpops

PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/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?
Back to top
View user's profile Send private message Visit poster's website
Turulo



Joined: 18 Jan 2008
Posts: 2

PostPosted: Fri Jan 18, 2008 9:16 pm    Post subject: Reply with quote

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:

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

PSP_MODULE_INFO("usbpops", 0x1000, 1, 1);


int test_thread(SceSize args, void *argp)
{
   char file[256];

   strcpy(file, "ms0:/psp/game/sles01760/EBOOT.PBP");

   struct SceKernelLoadExecVSHParam param;

   memset(&param, 0, sizeof(param));

   param.key = "pops";
   param.size = sizeof(param);
   param.args = strlen(file)+1;
   param.argp = file;

   sctrlKernelLoadExecVSHMs4(file, &param);
   //sctrlKernelLoadExecVSHMs4(file, NULL);

   sceKernelExitDeleteThread(0);

   return 0;
}

int module_start(SceSize args, void *argp)
{

   int thid = sceKernelCreateThread("loadExecVSHMs4Thread", test_thread, 14, 0x3000, 0, NULL);
   if(thid >= 0) sceKernelStartThread(thid, args, argp);

   sceKernelExitDeleteThread(0);

   return 0;
}
Back to top
View user's profile Send private message Visit poster's website
FreePlay



Joined: 04 Jan 2006
Posts: 71
Location: Schenectady, New York, USA

PostPosted: Sat Jan 19, 2008 7:30 pm    Post subject: Reply with quote

Yeah, I'm pretty sure discussion of this sort of thing isn't exactly kosher here.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group