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 

Launch ISO/CSO using C code...

 
Post new topic   This topic is locked: you cannot edit posts or make replies.    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
Stewie87



Joined: 03 Apr 2008
Posts: 39

PostPosted: Wed May 28, 2008 7:24 am    Post subject: Launch ISO/CSO using C code... Reply with quote

Hi guys, sorry for the disturb (and my very bad english!) :P
I need your help (again :P) ^__^

I want to launch an ISO/CSO from my program.
I used this code but PSP freeze and then crash:
Code:

void loadingUMD()
{
     sceKernelDelayThread(1000);
     struct SceKernelLoadExecVSHParam param;

     sceUmdActivate(1, "disc0:");
     sceUmdWaitDriveStat(UMD_WAITFORINIT);

     memset(&param, 0, sizeof(param));
     param.key = "game";
     param.size = sizeof(param);
     nkThreadResume(sceKernelGetThreadId());
     strcpy(file, "disc0:/PSP_GAME/SYSDIR/EBOOT.BIN");
     sctrlKernelLoadExecVSHDisc(file, NULL);
     sceKernelExitDeleteThread(0);
}

void loadingISOfile()
{
     sctrlSEUmountUmd();
     sctrlSESetDiscOut(1);
     sctrlSESetDiscType(0x10);
     sctrlSEMountUmdFromFile("ms0:/ISO/Spinout.iso",1,1);
     //sctrlSESetUmdFile(bpath);
     loadingUMD();
}


Any idea or suggestion?
I hope in your help, please :)

Bye and thank to all who answer me ;)
Back to top
View user's profile Send private message
jas0nuk



Joined: 27 Apr 2006
Posts: 137

PostPosted: Wed May 28, 2008 7:43 am    Post subject: Reply with quote

strcpy(file, "disc0:/PSP_GAME/SYSDIR/EBOOT.BIN");

This could cause an issue... how big is "file"?
Back to top
View user's profile Send private message
Stewie87



Joined: 03 Apr 2008
Posts: 39

PostPosted: Wed May 28, 2008 7:52 am    Post subject: Reply with quote

jas0nuk wrote:
strcpy(file, "disc0:/PSP_GAME/SYSDIR/EBOOT.BIN");

This could cause an issue... how big is "file"?


Code:
char file[64];


But i tried also with:
Code:
sctrlKernelLoadExecVSHDisc("disc0:/PSP_GAME/SYSDIR/EBOOT.BIN", NULL);

And always crash :'(
Back to top
View user's profile Send private message
Stewie87



Joined: 03 Apr 2008
Posts: 39

PostPosted: Wed May 28, 2008 8:37 am    Post subject: Reply with quote

I solve the freeze and crash with this new code:
Code:
void load_UMD()
{
     sceKernelDelayThread(500000);
     struct SceKernelLoadExecVSHParam param;
     const char target[33] = "disc0:/PSP_GAME/SYSDIR/EBOOT.BIN";
     if(sceUmdCheckMedium(0)!=0)
     {
                               
     sceUmdActivate(1, "disc0:");
     sceUmdWaitDriveStat(UMD_WAITFORINIT);
     
     memset(&param, 0, sizeof(param));
    param.key = "game";
    param.size = sizeof(param);
    param.args = strlen(target)+1;
    param.argp = target;
      sctrlKernelLoadExecVSHDisc(target, &param);
     sceKernelExitDeleteThread(0);
     }
}

void load_ISO()
{
     sctrlSEUmountUmd();
     sctrlSESetDiscOut(1);
     sctrlSESetDiscType(0x10);
     sctrlSEMountUmdFromFile("ms0:/ISO/Spinout.iso",1,1);
     load_UMD();
}


But now PSP return to dashboard in few seconds :(
Where I wrong?
Back to top
View user's profile Send private message
kid101skater



Joined: 20 Jun 2007
Posts: 26

PostPosted: Wed May 28, 2008 5:55 pm    Post subject: Reply with quote

Stewie87 wrote:
I solve the freeze and crash with this new code:
Code:
void load_UMD()
{
     sceKernelDelayThread(500000);
     struct SceKernelLoadExecVSHParam param;
     const char target[33] = "disc0:/PSP_GAME/SYSDIR/EBOOT.BIN";
     if(sceUmdCheckMedium(0)!=0)
     {
                               
     sceUmdActivate(1, "disc0:");
     sceUmdWaitDriveStat(UMD_WAITFORINIT);
     
     memset(&param, 0, sizeof(param));
    param.key = "game";
    param.size = sizeof(param);
    param.args = strlen(target)+1;
    param.argp = target;
      sctrlKernelLoadExecVSHDisc(target, &param);
     sceKernelExitDeleteThread(0);
     }
}

void load_ISO()
{
     sctrlSEUmountUmd();
     sctrlSESetDiscOut(1);
     sctrlSESetDiscType(0x10);
     sctrlSEMountUmdFromFile("ms0:/ISO/Spinout.iso",1,1);
     load_UMD();
}


But now PSP return to dashboard in few seconds :(
Where I wrong?


umm i think it would have to be because right at the end of loadumd you have scekernelexit... basicly causing a deletion of the thread forcing a return to the xmb... try it without sceKernelExitDeleteThread
Back to top
View user's profile Send private message
adrahil



Joined: 16 Mar 2006
Posts: 277

PostPosted: Wed May 28, 2008 8:31 pm    Post subject: Reply with quote

Read this first:
http://forums.ps2dev.org/viewtopic.php?t=17
Back to top
View user's profile Send private message
Stewie87



Joined: 03 Apr 2008
Posts: 39

PostPosted: Wed May 28, 2008 9:08 pm    Post subject: Reply with quote

adrahil wrote:
Read this first:
http://forums.ps2dev.org/viewtopic.php?t=17


I use my ISOs, taken from my UMDs, so I don't think that there is a copyright violation, no? :S
If also in this case there is a copyright violation I'm sorry :(
Back to top
View user's profile Send private message
kid101skater



Joined: 20 Jun 2007
Posts: 26

PostPosted: Thu May 29, 2008 11:05 am    Post subject: Reply with quote

Hey man... did my advice helpz?
Back to top
View user's profile Send private message
Stewie87



Joined: 03 Apr 2008
Posts: 39

PostPosted: Thu May 29, 2008 11:18 am    Post subject: Reply with quote

kid101skater wrote:
Hey man... did my advice helpz?


I tried your suggestion but it does not work yet...
But how the creators of all alternative shells do?! uff :(
Back to top
View user's profile Send private message
adrahil



Joined: 16 Mar 2006
Posts: 277

PostPosted: Fri May 30, 2008 5:31 pm    Post subject: Reply with quote

Well, although I heavily doubt what you're saying, I'll leave you the benefit of the doubt...
It is a copyright violation to make *backup* copies of them - in most countries. Unless you live in russia or some lost archipel such as Tokelau, you should have read the EULA more carefully :)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   This topic is locked: you cannot edit posts or make replies.    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