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 

Executing PBP's - some do not work

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



Joined: 09 Oct 2007
Posts: 409

PostPosted: Fri Mar 21, 2008 5:58 am    Post subject: Executing PBP's - some do not work Reply with quote

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.
_________________

Upgrade your PSP


Last edited by Pirata Nervo on Fri Mar 21, 2008 8:22 am; edited 1 time in total
Back to top
View user's profile Send private message
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Fri Mar 21, 2008 7:38 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Pirata Nervo



Joined: 09 Oct 2007
Posts: 409

PostPosted: Fri Mar 21, 2008 7:43 am    Post subject: Reply with quote

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:
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;
}

_________________

Upgrade your PSP
Back to top
View user's profile Send private message
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Fri Mar 21, 2008 4:22 pm    Post subject: Reply with quote

This is what psplink does (roughly).

Code:
#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?
Back to top
View user's profile Send private message
Pirata Nervo



Joined: 09 Oct 2007
Posts: 409

PostPosted: Fri Mar 21, 2008 6:26 pm    Post subject: Reply with quote

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
_________________

Upgrade your PSP
Back to top
View user's profile Send private message
Tinnus



Joined: 29 Jul 2006
Posts: 67

PostPosted: Sat Mar 22, 2008 12:05 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Pirata Nervo



Joined: 09 Oct 2007
Posts: 409

PostPosted: Sat Mar 22, 2008 1:22 am    Post subject: Reply with quote

Yeh I got it =)
_________________

Upgrade your PSP
Back to top
View user's profile Send private message
Question_dev



Joined: 24 Aug 2007
Posts: 88

PostPosted: Sat Mar 22, 2008 7:49 pm    Post subject: Reply with quote

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:

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);

}
Back to top
View user's profile Send private message
Pirata Nervo



Joined: 09 Oct 2007
Posts: 409

PostPosted: Sat Mar 22, 2008 8:43 pm    Post subject: Reply with quote

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.
_________________

Upgrade your PSP
Back to top
View user's profile Send private message
Question_dev



Joined: 24 Aug 2007
Posts: 88

PostPosted: Sat Mar 22, 2008 9:38 pm    Post subject: Reply with quote

??

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


Please help ty
Back to top
View user's profile Send private message
Pirata Nervo



Joined: 09 Oct 2007
Posts: 409

PostPosted: Sun Mar 23, 2008 1:38 am    Post subject: Reply with quote

You should know that you need systemctrl.h or loadexec_kernel.h
you will also need the thread manager library.
_________________

Upgrade your PSP
Back to top
View user's profile Send private message
Question_dev



Joined: 24 Aug 2007
Posts: 88

PostPosted: Sun Mar 23, 2008 2:28 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Pirata Nervo



Joined: 09 Oct 2007
Posts: 409

PostPosted: Sun Mar 23, 2008 3:50 am    Post subject: Reply with quote

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.
_________________

Upgrade your PSP
Back to top
View user's profile Send private message
Question_dev



Joined: 24 Aug 2007
Posts: 88

PostPosted: Sun Mar 23, 2008 4:03 am    Post subject: Reply with quote

Pirata Nervo THANKS !!!!



YOU are the BEST :p:p!!!!!!!
Back to top
View user's profile Send private message
Question_dev



Joined: 24 Aug 2007
Posts: 88

PostPosted: Sun Mar 23, 2008 4:06 am    Post subject: Reply with quote

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 !!!!
Back to top
View user's profile Send private message
Pirata Nervo



Joined: 09 Oct 2007
Posts: 409

PostPosted: Sun Mar 23, 2008 5:57 am    Post subject: Reply with quote

You should really LEARN C.
_________________

Upgrade your PSP
Back to top
View user's profile Send private message
Question_dev



Joined: 24 Aug 2007
Posts: 88

PostPosted: Sun Mar 23, 2008 7:47 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Pirata Nervo



Joined: 09 Oct 2007
Posts: 409

PostPosted: Sun Mar 23, 2008 8:43 am    Post subject: Reply with quote

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)
_________________

Upgrade your PSP
Back to top
View user's profile Send private message
Question_dev



Joined: 24 Aug 2007
Posts: 88

PostPosted: Sun Mar 23, 2008 4:19 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Pirata Nervo



Joined: 09 Oct 2007
Posts: 409

PostPosted: Sun Mar 23, 2008 8:04 pm    Post subject: Reply with quote

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?
_________________

Upgrade your PSP
Back to top
View user's profile Send private message
Question_dev



Joined: 24 Aug 2007
Posts: 88

PostPosted: Sun Mar 23, 2008 8:07 pm    Post subject: Reply with quote

Quote:
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
Back to top
View user's profile Send private message
Pirata Nervo



Joined: 09 Oct 2007
Posts: 409

PostPosted: Sun Mar 23, 2008 8:11 pm    Post subject: Reply with quote

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.
_________________

Upgrade your PSP
Back to top
View user's profile Send private message
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Mon Mar 24, 2008 3:12 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message AIM Address
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