Executing PBP's - some do not work

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

Moderators: cheriff, TyRaNiD

Post Reply
Pirata Nervo
Posts: 409
Joined: Tue Oct 09, 2007 4:22 am

Executing PBP's - some do not work

Post by Pirata Nervo »

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.
Last edited by Pirata Nervo on Fri Mar 21, 2008 8:22 am, edited 1 time in total.
Image
Upgrade your PSP
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

The problem is almost certainly you are an idiot. Alternatively are you passing the correct arguments. You need to pass the path to the EBOOT as the first argument to the program otherwise weird things can happen, hey it might not be the problem, if so see 1 :P
Pirata Nervo
Posts: 409
Joined: Tue Oct 09, 2007 4:22 am

Post by Pirata Nervo »

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:

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(&param, 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, &param);


	return loadexec;
}
Image
Upgrade your PSP
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

This is what psplink does (roughly).

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(&param, 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, &param);
Are you passing in a full path to the function or a relative path?
Pirata Nervo
Posts: 409
Joined: Tue Oct 09, 2007 4:22 am

Post by Pirata Nervo »

I use that function for 2 things:
1 - reset NervOS -> passes file path "ms0:/NervOS/EBOOT.PBP"
or
2 - Load Homebrew -> the returned string by the filebrowser.

Thank you VERY MUCH, your function works PERFECTLY. thanks TyRaNid.
You are the man : D
Image
Upgrade your PSP
Tinnus
Posts: 67
Joined: Sat Jul 29, 2006 1:12 am

Post by Tinnus »

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.
Pirata Nervo
Posts: 409
Joined: Tue Oct 09, 2007 4:22 am

Post by Pirata Nervo »

Yeh I got it =)
Image
Upgrade your PSP
Question_dev
Posts: 88
Joined: Fri Aug 24, 2007 8:23 pm

Post by Question_dev »

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

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(&param, 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, &param); 

}
Pirata Nervo
Posts: 409
Joined: Tue Oct 09, 2007 4:22 am

Post by Pirata Nervo »

maybe because you don't know what libraries are..
Don't use that function if you don't even know what you need to get it working.
Bookmark this thread and then one day, come here again if you know what this function needs.
Image
Upgrade your PSP
Question_dev
Posts: 88
Joined: Fri Aug 24, 2007 8:23 pm

Post by Question_dev »

??

I'm here to solve a problem.
I code it but it isn't working


Please help ty
Pirata Nervo
Posts: 409
Joined: Tue Oct 09, 2007 4:22 am

Post by Pirata Nervo »

You should know that you need systemctrl.h or loadexec_kernel.h
you will also need the thread manager library.
Image
Upgrade your PSP
Question_dev
Posts: 88
Joined: Fri Aug 24, 2007 8:23 pm

Post by Question_dev »

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
Pirata Nervo
Posts: 409
Joined: Tue Oct 09, 2007 4:22 am

Post by Pirata Nervo »

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.
Image
Upgrade your PSP
Question_dev
Posts: 88
Joined: Fri Aug 24, 2007 8:23 pm

Post by Question_dev »

Pirata Nervo THANKS !!!!



YOU are the BEST :p:p!!!!!!!
Question_dev
Posts: 88
Joined: Fri Aug 24, 2007 8:23 pm

Post by Question_dev »

And how do i add a the code to load for example png files, and pbp's ?
And hwo do i add th text [FOLDER] before each folder ?

Thanks in advance !

Btw i'm soooooo happy !!:d:d:p:p:p !!!!
Pirata Nervo
Posts: 409
Joined: Tue Oct 09, 2007 4:22 am

Post by Pirata Nervo »

You should really LEARN C.
Image
Upgrade your PSP
Question_dev
Posts: 88
Joined: Fri Aug 24, 2007 8:23 pm

Post by Question_dev »

I'm learning it. . . Thats why i'm here. . .

You wannna post your code snippet to load a pbp/png file in Slash's filebrowser?

I Only need that code.That's my "start" With that code i can do everything. I can change it to load other files, etc. .

Plz, pirata nervo,
Help me out!

Tnx in advance
Pirata Nervo
Posts: 409
Joined: Tue Oct 09, 2007 4:22 am

Post by Pirata Nervo »

No, it's my work and it's not load png/pbp file code, it's one function which loads and displays the image or runs the eboot.

Edit, this place is not for learning C, this place is for learning how to make homebrew for psp (you must know C before making it)
Image
Upgrade your PSP
Question_dev
Posts: 88
Joined: Fri Aug 24, 2007 8:23 pm

Post by Question_dev »

tnx for the help. . .

And i known, its your code, but i only ask tips.

Just say in wich function i need to work. Thats all.

Thnx
Pirata Nervo
Posts: 409
Joined: Tue Oct 09, 2007 4:22 am

Post by Pirata Nervo »

If you don't even know how to blit images, HOW THE HELL would you like to know how to run PBP'S!!!!! damn, is it that hard???
RESEARCH, do you know what is it?
Image
Upgrade your PSP
Question_dev
Posts: 88
Joined: Fri Aug 24, 2007 8:23 pm

Post by Question_dev »

If you don't even know how to blit images, HOW THE HELL would you like to know how to run PBP'S!!!!! damn, is it that hard???
RESEARCH, do you know what is it?

I now !! READ MY POST AT FILEBROWSER THREAD
Pirata Nervo
Posts: 409
Joined: Tue Oct 09, 2007 4:22 am

Post by Pirata Nervo »

If you did the research you should know how to use the file browser.
This is off-topic so, post anywhere else but not in my thread.
Image
Upgrade your PSP
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

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.
Post Reply