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 

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

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



Joined: 29 Aug 2007
Posts: 168

PostPosted: Wed Oct 01, 2008 6:13 am    Post subject: Make a PRX load in a certain game. [Solved] Reply with quote

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:
/**
 * 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
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Dariusc123456



Joined: 12 Aug 2008
Posts: 394

PostPosted: Wed Oct 01, 2008 7:53 am    Post subject: Re: PRX game load Reply with quote

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:
/**
 * 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.
Back to top
View user's profile Send private message AIM Address
Ruj89



Joined: 12 Jun 2007
Posts: 12

PostPosted: Wed Oct 01, 2008 8:19 am    Post subject: Reply with quote

If you know the module name of the game, it shouldn't be too hard to code...
Back to top
View user's profile Send private message
Super Sheep



Joined: 23 Mar 2008
Posts: 31

PostPosted: Wed Oct 01, 2008 8:44 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
moonlight



Joined: 26 Oct 2005
Posts: 567

PostPosted: Wed Oct 01, 2008 11:00 pm    Post subject: Reply with quote

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



Joined: 29 Aug 2007
Posts: 168

PostPosted: Thu Oct 02, 2008 4:41 am    Post subject: Reply with quote

*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:

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


or

Code:

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
Back to top
View user's profile Send private message Send e-mail MSN Messenger
angelo



Joined: 29 Aug 2007
Posts: 168

PostPosted: Fri Oct 03, 2008 2:30 am    Post subject: Reply with quote

I did this:

Code:
  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
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Cpasjuste



Joined: 29 May 2005
Posts: 214

PostPosted: Fri Oct 03, 2008 12:16 pm    Post subject: Reply with quote

I would go for an easy way :

If(!findmodulebyname("go module name")) selfstopunloadmodule;
Back to top
View user's profile Send private message
angelo



Joined: 29 Aug 2007
Posts: 168

PostPosted: Fri Oct 03, 2008 4:42 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
angelo



Joined: 29 Aug 2007
Posts: 168

PostPosted: Sat Oct 04, 2008 4:06 am    Post subject: Reply with quote

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:

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?
Back to top
View user's profile Send private message Send e-mail MSN Messenger
kloplop321



Joined: 18 Mar 2008
Posts: 1

PostPosted: Sun Oct 05, 2008 2:23 am    Post subject: Re: PRX game load Reply with quote

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



Joined: 29 Aug 2007
Posts: 168

PostPosted: Sun Oct 05, 2008 2:38 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Send e-mail MSN Messenger
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Sun Oct 05, 2008 5:09 am    Post subject: Reply with quote

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:

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:
/**
 * 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:

char name[512];
kuKernelInitFileName(name);
if (!strcmp(name, "GoMessengerClient")){
  LoadDrivers("ms0:/SEPlugins/piKey/HomebrewDrivers/piKeyGOKOut", 0);
  }else{
  LoadDrivers("ms0:/SEPlugins/piKey/HomebrewDrivers/piKeyDanzeffKOut", 0);
  }
Back to top
View user's profile Send private message AIM Address
angelo



Joined: 29 Aug 2007
Posts: 168

PostPosted: Tue Oct 07, 2008 8:58 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Send e-mail MSN Messenger
angelo



Joined: 29 Aug 2007
Posts: 168

PostPosted: Sat Oct 11, 2008 2:45 am    Post subject: Output Reply with quote

Fixed it!

Code:
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!
Back to top
View user's profile Send private message Send e-mail MSN Messenger
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