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 

Loading Code While still in XMB?

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



Joined: 05 Oct 2005
Posts: 14

PostPosted: Thu Mar 09, 2006 10:28 pm    Post subject: Loading Code While still in XMB? Reply with quote

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:
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:
/*
 * 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 (c) 2005 James Forshaw <tyranid@gmail.com>
 *
 * $Id: main.c 1531 2005-12-07 18:27:12Z tyranid $
 */
#include <pspkernel.h>
#include <stdio.h>
#include <pspctrl.h>
#include <pspumd.h>

PSP_MODULE_INFO("TESTPRX", 0x1000, 1, 1);

#define WELCOME_MESSAGE "Hello from the PRX\n"

int main(int argc, char **argv)
{
   SceCtrlData ctl;
   int i = 0;
   
   printf("Hello from the prx, please press [X] to run UMD\n");
   printf("or START to quit, :)\n");
   

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

   sceKernelExitGame();
   //sceKernelSleepThread();

   return 0;
}

/* Exported function returns the address of module_info */
void* getModuleInfo(void)
{
   return (void *) &module_info;
}

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



Joined: 18 Jan 2004
Posts: 918

PostPosted: Fri Mar 10, 2006 4:23 am    Post subject: Reply with quote

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?repname=psp&path=%2Ftrunk%2Fpsplink%2Fscripts%2Floadvsh.sh&rev=1824&sc=1
Back to top
View user's profile Send private message
c5cha7



Joined: 05 Oct 2005
Posts: 14

PostPosted: Sat Mar 11, 2006 12:52 am    Post subject: Reply with quote

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?repname=psp&path=%2Ftrunk%2Fpsplink%2Fscripts%2Floadvsh.sh&rev=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
Back to top
View user's profile Send private message
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