Launch ISO/CSO using C code...

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

Moderators: cheriff, TyRaNiD

Locked
Stewie87
Posts: 34
Joined: Thu Apr 03, 2008 8:16 am

Launch ISO/CSO using C code...

Post by Stewie87 »

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: Select all

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 ;)
jas0nuk
Posts: 137
Joined: Thu Apr 27, 2006 8:00 am

Post by jas0nuk »

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

This could cause an issue... how big is "file"?
Stewie87
Posts: 34
Joined: Thu Apr 03, 2008 8:16 am

Post by Stewie87 »

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

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

Code: Select all

char file[64];
But i tried also with:

Code: Select all

sctrlKernelLoadExecVSHDisc("disc0:/PSP_GAME/SYSDIR/EBOOT.BIN", NULL);
And always crash :'(
Stewie87
Posts: 34
Joined: Thu Apr 03, 2008 8:16 am

Post by Stewie87 »

I solve the freeze and crash with this new code:

Code: Select all

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?
kid101skater
Posts: 26
Joined: Wed Jun 20, 2007 6:13 am

Post by kid101skater »

Stewie87 wrote:I solve the freeze and crash with this new code:

Code: Select all

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
adrahil
Posts: 274
Joined: Thu Mar 16, 2006 1:55 am

Post by adrahil »

Stewie87
Posts: 34
Joined: Thu Apr 03, 2008 8:16 am

Post by Stewie87 »

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 :(
kid101skater
Posts: 26
Joined: Wed Jun 20, 2007 6:13 am

Post by kid101skater »

Hey man... did my advice helpz?
Stewie87
Posts: 34
Joined: Thu Apr 03, 2008 8:16 am

Post by Stewie87 »

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 :(
adrahil
Posts: 274
Joined: Thu Mar 16, 2006 1:55 am

Post by adrahil »

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 :)
Locked