Loading Code While still in XMB?

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

Moderators: cheriff, TyRaNiD

Post Reply
c5cha7
Posts: 14
Joined: Wed Oct 05, 2005 9:36 pm

Loading Code While still in XMB?

Post by c5cha7 »

Hi i am trying to load my code in the XMB
like PSPShot (Which doesnt have a source)
And a freind told me that it can be done throught
PRX files, He said they still stay intact when i exit
back to the XMB? but somehow they get erased?

Heres a quote:
well, i've been testing with this and its very simple really, go to your samples in the pspsdk, and there is two samples, sample prx, and sample prx loader, what i have done is made an eboot, that does all my interface and crap, and then when the user wants to boot to the UMD, i load the prx, and then load the UMD, the prx will stay in the kernel memory space. so just go find those samples, play with them, and you'll be on your way. HINT: a good way to do xmb stuff is to simply load your prx, and then call sceKernelExitGame(); it will not be wiped from the memory as it is still in the kernel. good luck with whatever your doing!
Heres my code:

Code: Select all

/*
 * PSP Software Development Kit - http://www.pspdev.org
 * -----------------------------------------------------------------------
 * Licensed under the BSD license, see LICENSE in PSPSDK root for details.
 *
 * main.c - Simple PRX example.
 *
 * Copyright &#40;c&#41; 2005 James Forshaw <[email protected]>
 *
 * $Id&#58; main.c 1531 2005-12-07 18&#58;27&#58;12Z tyranid $
 */
#include <pspkernel.h>
#include <stdio.h>
#include <pspctrl.h>
#include <pspumd.h>

PSP_MODULE_INFO&#40;"TESTPRX", 0x1000, 1, 1&#41;;

#define WELCOME_MESSAGE "Hello from the PRX\n"

int main&#40;int argc, char **argv&#41;
&#123;
	SceCtrlData ctl;
	int i = 0;
	
	printf&#40;"Hello from the prx, please press &#91;X&#93; to run UMD\n"&#41;;
	printf&#40;"or START to quit, &#58;&#41;\n"&#41;;
	

	while &#40;i ==0&#41;
	&#123;
		sceCtrlReadBufferPositive   &#40;&ctl, 1&#41;;
		if &#40;ctl.Buttons & PSP_CTRL_START&#41;
		&#123;
			i = 1;
			break;
		&#125;
		if &#40;ctl.Buttons & PSP_CTRL_CROSS&#41;
		&#123;
			printf&#40;"Executing UMD\n"&#41;;
			sceKernelLoadExec&#40;"disc0&#58;/PSP_GAME/SYSDIR/BOOT.BIN",0&#41;;
			printf&#40;"Finished executing UMD\n"&#41;;
		&#125;
		sceKernelDelayThread&#40;1000    &#41;; //sleep a bit so we don't take all the cpu time
	&#125;

	sceKernelExitGame&#40;&#41;;
	//sceKernelSleepThread&#40;&#41;;

	return 0;
&#125;

/* Exported function returns the address of module_info */
void* getModuleInfo&#40;void&#41;
&#123;
	return &#40;void *&#41; &module_info;
&#125;
But i want it to say that while in the XMB?
Also i am using the PRX Loader to load it.
Currently Working On
PSP Chao Garden - Lua
Next Project might be
Dragon Ball P
or Metroid Prime
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

I think you have been sold a dummy tbh, it isn't quite as quoted.

I reality calling sceKernelExitGame or sceKernelLoadExec will reboot the PSP, exit game will reload the VSH, loadexec _should_ load your app but any code you have running will not survive the reboot without intervention.

The key is to use sceKernelLoadModule/StartModule _NOT_ LoadExec to start the game, and you really should stop and unload the prx loader once your kernel prx kicks off so that user memory is as clean as possible.

If you must load the VSH back up (and I cannot quite see the point except you can take screenshots of it) follow the psplink script which does exactly that http://svn.pspdev.org/filedetails.php?r ... =1824&sc=1
c5cha7
Posts: 14
Joined: Wed Oct 05, 2005 9:36 pm

Post by c5cha7 »

TyRaNiD wrote:I think you have been sold a dummy tbh, it isn't quite as quoted.

I reality calling sceKernelExitGame or sceKernelLoadExec will reboot the PSP, exit game will reload the VSH, loadexec _should_ load your app but any code you have running will not survive the reboot without intervention.

The key is to use sceKernelLoadModule/StartModule _NOT_ LoadExec to start the game, and you really should stop and unload the prx loader once your kernel prx kicks off so that user memory is as clean as possible.

If you must load the VSH back up (and I cannot quite see the point except you can take screenshots of it) follow the psplink script which does exactly that http://svn.pspdev.org/filedetails.php?r ... =1824&sc=1
Wow some great help here!
I Will not forget this!
Thanks.
Currently Working On
PSP Chao Garden - Lua
Next Project might be
Dragon Ball P
or Metroid Prime
Post Reply