Make a PRX load in a certain game. [Solved]

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

Moderators: cheriff, TyRaNiD

Post Reply
angelo
Posts: 168
Joined: Wed Aug 29, 2007 9:34 pm

Make a PRX load in a certain game. [Solved]

Post by angelo »

Is it possible for a plugin to load in a specific game? The plugin one of my team has made has been designed specificly for Go! Messenger and causes a LOT of problems in other applications. The plugin is launched by a PRX engine.

I found this, but I'm not sure if it is usefull:

Code: Select all

/**
 * Gets the api type 
 *
 * @returns the api type in which the system has booted
*/
int kuKernelInitApitype();

/**
 * Gets the filename of the executable to be launched after all modules of the api.
 *
 * @param initfilename - String where copy the initfilename
 * @returns 0 on success
*/
int kuKernelInitFileName(char *initfilename);

/**
 *
 * Gets the device in which the application was launched.
 *
 * @returns the device code, one of PSPBootFrom values.
*/
int kuKernelBootFrom();

/**
 * Get the key configuration in which the system has booted.
 *
 * @returns the key configuration code, one of PSPKeyConfig values 
*/
int kuKernelInitKeyConfig();
I want to do something like this:
Last edited by angelo on Sat Oct 11, 2008 5:29 am, edited 2 times in total.
Dariusc123456
Posts: 388
Joined: Tue Aug 12, 2008 12:46 am

Re: PRX game load

Post by Dariusc123456 »

angelo wrote:Is it possible for a plugin to load in a specific game? The plugin I've made has been designed specificly for Go! Messenger and causes a LOT of problems in other applications. The plugin is launched by a PRX engine.

I found this, but I'm not sure if it is usefull:

Code: Select all

/**
 * Gets the api type 
 *
 * @returns the api type in which the system has booted
*/
int kuKernelInitApitype();

/**
 * Gets the filename of the executable to be launched after all modules of the api.
 *
 * @param initfilename - String where copy the initfilename
 * @returns 0 on success
*/
int kuKernelInitFileName(char *initfilename);

/**
 *
 * Gets the device in which the application was launched.
 *
 * @returns the device code, one of PSPBootFrom values.
*/
int kuKernelBootFrom();

/**
 * Get the key configuration in which the system has booted.
 *
 * @returns the key configuration code, one of PSPKeyConfig values 
*/
int kuKernelInitKeyConfig();
I want to do something like this:
If you are trying to make a game in prx game, then you have to do alot of things.
Ruj89
Posts: 12
Joined: Tue Jun 12, 2007 7:12 am

Post by Ruj89 »

If you know the module name of the game, it shouldn't be too hard to code...
Super Sheep
Posts: 31
Joined: Sun Mar 23, 2008 2:16 am
Contact:

Post by Super Sheep »

Check the systemctrl.h from the m33 sdk. There is a a modulestart handler which you can detect if the game you want is loaded.
moonlight
Posts: 567
Joined: Wed Oct 26, 2005 7:46 pm

Post by moonlight »

If you want to detect just GO MESSENGER, you could use sceKernelInitFilename to know the path of the file, read it, check if it is a pbp, if it so, read the sfo and compare the game code with the one of GO MESSENGER.
This wouldn't work with hombebrew pbp's because they all use same gamecode, but it will work for GO MESSENGER.
angelo
Posts: 168
Joined: Wed Aug 29, 2007 9:34 pm

Post by angelo »

*Bows*

Thanks Moonlight! Best help ever!

I managed to extract the Disk ID from the SFO it's ULES00856.

So would I just do this?

Code: Select all

if sceKernelInitFilename(ULES00856);
{
pspSdkLoadStartModule("module.prx", PSP_MEMORY_PARTITION_KERNEL);
}
or

Code: Select all

if sceKernelInitFilename(ms0:\PSP\GAME\APP\ULES00856\EBOOT.PBP);
{
pspSdkLoadStartModule("module.prx", PSP_MEMORY_PARTITION_KERNEL);
}
Is that how it works? the SDK is a little brief... :-/

Angelo
angelo
Posts: 168
Joined: Wed Aug 29, 2007 9:34 pm

Post by angelo »

I did this:

Code: Select all

  LoadDrivers("ms0:/seplugins/pikey/inputdrivers", 1);
  if (kuKernelInitFileName("ULES00856"))
  {
  LoadDrivers("ms0:/seplugins/pikey/GoK", 0);
  }else{
  LoadDrivers("ms0:/seplugins/pikey/outputdrivers", 0);
  }
  sioPrint("--- All plugins loaded ---\r\n");
  displayStatusText("piKey is now ACTIVE");
No errors, but the system isn't working.

The Disk ID of Go! Messenger is ULES00856 and when it's running I want the PRX's in the "GoK" folder to load. Otherwise, then just the modules in "outputdrivers".

I'm quite confused.

Angelo
Cpasjuste
Posts: 214
Joined: Sun May 29, 2005 8:28 am

Post by Cpasjuste »

I would go for an easy way :

If(!findmodulebyname("go module name")) selfstopunloadmodule;
angelo
Posts: 168
Joined: Wed Aug 29, 2007 9:34 pm

Post by angelo »

I get that... it's just knowing what the Go! Messenger module is!

I'm off to school now, but I'll have another bash at it tonight.

Angelo

EDIT: Ahh! Brainwave. Like many common Sony EBOOTs, they load a DATA.DRM file. Maybe I can test to see if that counts as a module.
angelo
Posts: 168
Joined: Wed Aug 29, 2007 9:34 pm

Post by angelo »

Grrr! I'm getting anoyed now! I've been doing this for 3 days and it seems I'm getting nowhere!

Here's my code so far:

Code: Select all

if (kuKernelInitFileName("GoMessengerClient")){
  LoadDrivers("ms0:/SEPlugins/piKey/HomebrewDrivers/piKeyGOKOut", 0);
  }else{
  LoadDrivers("ms0:/SEPlugins/piKey/HomebrewDrivers/piKeyDanzeffKOut", 0);
  }
All I need is a simple IF statement to see if Go! Messenger is running and I'm unable to retrieve any information from it!

Any help?
kloplop321
Posts: 1
Joined: Tue Mar 18, 2008 7:31 am

Re: PRX game load

Post by kloplop321 »

angelo wrote:Is it possible for a plugin to load in a specific game? The plugin I've made has been designed specificly for Go! Messenger and causes a LOT of problems in other applications. The plugin is launched by a PRX engine.
you know as well as I do that I made it, mostly blind :P
angelo
Posts: 168
Joined: Wed Aug 29, 2007 9:34 pm

Post by angelo »

It's odd... the plugin works great in Go! Messenger, but just causes issues in other applications! Ironic eh?

I've been trying for hours to get this to work. I know the game code is "ULES00856", but I'm not sure how to see if ULES00856 is running. I've tried using modules and other stuff. Grrrr!

Any help please guys? I'm completly stuck!

Angelo
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

angelo wrote:Grrr! I'm getting anoyed now! I've been doing this for 3 days and it seems I'm getting nowhere!

Here's my code so far:

Code: Select all

if (kuKernelInitFileName("GoMessengerClient")){
    LoadDrivers("ms0:/SEPlugins/piKey/HomebrewDrivers/piKeyGOKOut", 0);
}else{
    LoadDrivers("ms0:/SEPlugins/piKey/HomebrewDrivers/piKeyDanzeffKOut", 0);
}
All I need is a simple IF statement to see if Go! Messenger is running and I'm unable to retrieve any information from it!

Any help?
You're using the function wrong... look at the definition in the header file:

Code: Select all

/**
 * Gets the filename of the executable to be launched after all modules of the api.
 *
 * @param initfilename - String where copy the initfilename
 * @returns 0 on success
*/
int kuKernelInitFileName(char *initfilename);
Look closely at the initfilename parameter: it's the string where the name is COPIED, not a string to search for. You need something more like:

Code: Select all

char name[512];
kuKernelInitFileName(name);
if (!strcmp(name, "GoMessengerClient")){
  LoadDrivers("ms0:/SEPlugins/piKey/HomebrewDrivers/piKeyGOKOut", 0);
  }else{
  LoadDrivers("ms0:/SEPlugins/piKey/HomebrewDrivers/piKeyDanzeffKOut", 0);
  }
angelo
Posts: 168
Joined: Wed Aug 29, 2007 9:34 pm

Post by angelo »

Thanks J.F.K!

I haven't been on my PC in a while due to school. I'll try it out when I get home.

I may even use the DisplayTextStatus as a debug so I can see what value i'll have to type in.

Thanks!

Angelo
angelo
Posts: 168
Joined: Wed Aug 29, 2007 9:34 pm

Output

Post by angelo »

Fixed it!

Code: Select all

InitVars();
  gvshmode = waitForModule("sceVshBridge_Driver");
  GoMessengerRunning = waitForModule("GoMessengerClient");  
  
  if (gvshmode)
  {
  sioPrint("Detected VSH mode\r\n");
  // sleep here to avoid corrupting the startup animation
  sceKernelDelayThread(1 * 100 * 1000);
  }
  else
  {
  sioPrint("Detected GAME mode\r\n");
  }
  LoadDrivers("ms0:/SEPlugins/piKey/InputDrivers", 1);
  if (GoMessengerRunning){ 
  LoadDrivers("ms0:/SEPlugins/piKey/HomebrewDrivers/piKeyGOKOut", 0);
  }  
  LoadDrivers("ms0:/SEPlugins/piKey/OutputDrivers", 0);
  sioPrint("--- All plugins loaded ---\r\n");
  displayStatusText("piKey is now ACTIVE"); 
Runs as smooth as silk. Thanks guys!
Post Reply