Execution:
Code: Select all
//////////////////////Loading a PRX
int LoadAndStartModule_PRX(char *ModuleFILE, int UserMode)//UserMode mode: 1==true; 0 == false;
{//start moduling
SceKernelLMOption moduleprx;
moduleprx.mpidtext = (UserMode+1);// 2 is equivalent to usermode ;)
moduleprx.mpiddata = (UserMode+1);// 2 is equivalent to usermode ;)
moduleprx.position = 0;
moduleprx.access = 1;
moduleprx.size = sizeof(moduleprx);
SceUID PrxID=0;
PrxID = sceKernelLoadModuleMs(ModuleFILE,0,UserMode > 0 ? &moduleprx : NULL);// If in usermode, don't call as NULL >:// this carrys MS for Memory Stick ;)
int prxstatus=-1;
if( ( sceKernelStartModule (PrxID, 0,NULL,&prxstatus,NULL) ) !=0)// it was :if( ( sceKernelStartModule (PrxID, 0,NULL,&prxstatus,moduleprx) ) !=0)
{//I think this is an okay error check<-
//do nothing until necessary... :), but this is on an errors existance
}//last argument is 0 for usermode! #3 is NULL becaus it's okay, and I don't know wtf it's it's honestly asking for... :'(
//Finish MODULING: Stop & Unload Relative MODULE
sceKernelStopModule(PrxID, 0, NULL,&prxstatus,NULL);// it was:sceKernelStopModule(PrxID, 0, NULL,&prxstatus,moduleprx);
sceKernelUnloadModule(PrxID);
return prxstatus;
}//end moduling
//////////////////////Loading a PRX
Code: Select all
if(Controller.Buttons & PSP_CTRL_LTRIGGER){LoadAndStartModule_PRX("ms0:/XT1_Module.prx", 0);}
* It's in the right directory.
* After changing the name read in the sample loader, the PRX tested as *Working*
Thank You!!