Executing PBP's - some do not work
-
- Posts: 409
- Joined: Tue Oct 09, 2007 4:22 am
Executing PBP's - some do not work
I've tried using sctrlKernelLoadExecVSHMs2 -> user mode, sceKernelLoadExecVs2-> from kernel prx and some PBP's cannot run.
My EBOOT.PBP is located at:
ms0:/NervOS/EBOOT.PBP
the returned error is "No Current Working Directory".
Does anyone know how can I fix this problem?
I've tried with the simple load exec function parameters and with all parameters, but I still get the error.
My EBOOT.PBP is located at:
ms0:/NervOS/EBOOT.PBP
the returned error is "No Current Working Directory".
Does anyone know how can I fix this problem?
I've tried with the simple load exec function parameters and with all parameters, but I still get the error.
Last edited by Pirata Nervo on Fri Mar 21, 2008 8:22 am, edited 1 time in total.
-
- Posts: 409
- Joined: Tue Oct 09, 2007 4:22 am
Thank you for calling me idiot. I edited my post, do you think I would put user mode as parameter? omg
This is my function:
This is my function:
Code: Select all
int LoadHomebrew(const char * file)
{
int loadexec = 0;
memset(vshmain_args, 0, sizeof(vshmain_args));
vshmain_args[0x40] = 1;
vshmain_args[0x280] = 1;
vshmain_args[0x284] = 3;
vshmain_args[0x286] = 5;
struct SceKernelLoadExecVSHParam param;
memset(¶m, 0, sizeof(param));
param.size = sizeof(param);
param.args = strlen(file)+1;
param.argp = &file;
param.key = "game";
//param.configfile = "/kd/pspbtcnf_game.txt";
param.vshmain_args_size = sizeof(vshmain_args);
param.vshmain_args = vshmain_args;
param.unk4 = 0;
param.unk5 = 0;
loadexec = sceKernelLoadExecVSHMs2(file, ¶m);
return loadexec;
}
This is what psplink does (roughly).
Are you passing in a full path to the function or a relative path?
Code: Select all
#define LOAD_PATH "ms0:/PSP/GAME/psplink/EBOOT.PBP"
struct SceKernelLoadExecVSHParam param;
char argp[256];
int args;
strcpy(argp, LOAD_PATH);
args = strlen(LOAD_PATH)+1;
memset(¶m, 0, sizeof(param));
param.size = sizeof(param);
param.args = args;
param.argp = argp;
param.key = NULL;
param.vshmain_args_size = 0;
param.vshmain_args = NULL;
sceKernelSuspendAllUserThreads();
sceKernelLoadExecVSHMs2(LOAD_PATH, ¶m);
-
- Posts: 409
- Joined: Tue Oct 09, 2007 4:22 am
For the record, I think the problem was you passing &file to argp. "file" was already a pointer to the path, and &path makes it a double pointer which is apparently (accordingly to TyRaNiD's code) not what it expects (unlike "PC-like" argv's which are a pointer to a dynamic array).
Let's see what the PSP reserves... well, I'd say anything is better than Palm OS.
-
- Posts: 88
- Joined: Fri Aug 24, 2007 8:23 pm
When i try to compile that PSPLink code i get :
main.c: In function 'Web':
main.c(134) : error: storage size of 'param' isn't known
main.c(148) : warning: implicit declaration of function 'sceKernelSuspendAllUser
Threads'
main.c(149) : warning: implicit declaration of function 'sceKernelLoadExecVSHMs2
'
Code
main.c: In function 'Web':
main.c(134) : error: storage size of 'param' isn't known
main.c(148) : warning: implicit declaration of function 'sceKernelSuspendAllUser
Threads'
main.c(149) : warning: implicit declaration of function 'sceKernelLoadExecVSHMs2
'
Code
Code: Select all
void Web(){
#define LOAD_PATH "ms0:/PSP/GAME/TestApp/EBOOT.PBP"
struct SceKernelLoadExecVSHParam param;
char argp[256];
int args;
strcpy(argp, LOAD_PATH);
args = strlen(LOAD_PATH)+1;
memset(¶m, 0, sizeof(param));
param.size = sizeof(param);
param.args = args;
param.argp = argp;
param.key = NULL;
param.vshmain_args_size = 0;
param.vshmain_args = NULL;
sceKernelSuspendAllUserThreads();
sceKernelLoadExecVSHMs2(LOAD_PATH, ¶m);
}
-
- Posts: 409
- Joined: Tue Oct 09, 2007 4:22 am
-
- Posts: 88
- Joined: Fri Aug 24, 2007 8:23 pm
-
- Posts: 409
- Joined: Tue Oct 09, 2007 4:22 am
-
- Posts: 88
- Joined: Fri Aug 24, 2007 8:23 pm
Ok,
So i need to add #include <systemctrl.h> OR #include <loadexec_kernel.h> to my code
AND download and install the thread manager library ?
Thanks in advance
EDIT : Normally, if people help you with your code, if it's solved, they post their worked code here to help other people...
EDIT : @ Pirata Nervo : BTW, you made NervOS, nice app :p But i saw that the filebrowser was made by Slash. You wanna help me/our and giving the source of the filebrowser or the email of slash ? Tnx very much
So i need to add #include <systemctrl.h> OR #include <loadexec_kernel.h> to my code
AND download and install the thread manager library ?
Thanks in advance
EDIT : Normally, if people help you with your code, if it's solved, they post their worked code here to help other people...
EDIT : @ Pirata Nervo : BTW, you made NervOS, nice app :p But i saw that the filebrowser was made by Slash. You wanna help me/our and giving the source of the filebrowser or the email of slash ? Tnx very much
-
- Posts: 409
- Joined: Tue Oct 09, 2007 4:22 am
No Question_dev, this is why I told you to wait more time before going into advanced C programming, you don't even know what to do when using another library.
I might help you with your code, not with your C skills.
Get the source code from here:
http://slasher.team-duck.com/
I used his file browser but note that I MODIFIED IT, I changed almost everything, including the structures.
I might help you with your code, not with your C skills.
Get the source code from here:
http://slasher.team-duck.com/
I used his file browser but note that I MODIFIED IT, I changed almost everything, including the structures.
-
- Posts: 88
- Joined: Fri Aug 24, 2007 8:23 pm
-
- Posts: 88
- Joined: Fri Aug 24, 2007 8:23 pm
-
- Posts: 409
- Joined: Tue Oct 09, 2007 4:22 am
-
- Posts: 88
- Joined: Fri Aug 24, 2007 8:23 pm
-
- Posts: 409
- Joined: Tue Oct 09, 2007 4:22 am
-
- Posts: 88
- Joined: Fri Aug 24, 2007 8:23 pm
-
- Posts: 409
- Joined: Tue Oct 09, 2007 4:22 am
-
- Posts: 88
- Joined: Fri Aug 24, 2007 8:23 pm
-
- Posts: 409
- Joined: Tue Oct 09, 2007 4:22 am
One good way to locate various kinds of code is to look at the source for programs that do things you like. Look at the file browser in Doom for the PSP. It fetches all entries in a directory, sorts them, then displays them in a list. If you like how it works, just look at the source that comes with Doom for the PSP. Even if it's not PRECISELY what you want, you might learn enough from looking at it to do what you want yourself.