| View previous topic :: View next topic |
| Author |
Message |
angelo
Joined: 29 Aug 2007 Posts: 168
|
Posted: Sun Aug 10, 2008 12:07 am Post subject: How to make a config file? |
|
|
Hello, guys. I've coded this EBOOT launcher however I want to make a config file for it so the the can allocate it's target:
Here's my function and what I use to run it:
| Code: | //Load_EBOOT Function
void Load_EBOOT(char *target)
{
struct SceKernelLoadExecVSHParam param;
memset(¶m, 0, sizeof(param));
param.key = "game";
param.size = sizeof(param);
param.args = strlen(target)+1;
param.argp = target;
sctrlKernelLoadExecVSHMs2(target, ¶m);
}
//EBOOT 1
if (isKeyPressed(KEY_1) && ctrl && alt){
displayStatusText("Loading Application 1...");
sceKernelDelayThread(3 * 1000 * 1000);
Load_EBOOT("ms0:/SEPlugins/piKey/Applications/App1/EBOOT.PBP");
} |
I've come up with this so far:
| Code: | int Application_1 = 0;
// Read the config file
int cfg = configOpen("ms0:/SEPlugins/piKey/AppLaunchConfig.txt");
if (cfg >= 0)
{
while (configRead(cfg, cfgtoken, cfgvalue))
{
if (strcmp(cfgtoken, "Application 1") == 0)
{
Application_1 = (cfgvalue);
}
}
}
//EBOOT 1
if (isKeyPressed(KEY_1) && ctrl && alt){
displayStatusText("Loading Application 1...");
sceKernelDelayThread(3 * 1000 * 1000);
Load_EBOOT(Application_1);
} |
It gives the following errors:
| Code: | ctrlout.c:515: warning: assignment makes integer from pointer without a cast
ctrlout.c:526: warning: passing argument 1 of 'Load_EBOOT' makes pointer from integer without a cast |
I also have this in the config file:
| Code: | | Application 1 = "ms0:/SEPlugins/piKey/Applications/App1/EBOOT.PBP" |
Any ideas please?
Anything is greatly appreciated!
Angelo |
|
| Back to top |
|
 |
Insert_witty_name
Joined: 10 May 2006 Posts: 376
|
Posted: Sun Aug 10, 2008 12:19 am Post subject: |
|
|
| See moonlight's config code in his 1.5 cfw proof of concept. |
|
| Back to top |
|
 |
J.F.
Joined: 22 Feb 2004 Posts: 2906
|
Posted: Sun Aug 10, 2008 4:15 am Post subject: |
|
|
| The compiler output is useless since we don't know what lines correspond to the numbers, nor have some of the functions they refer to. |
|
| Back to top |
|
 |
angelo
Joined: 29 Aug 2007 Posts: 168
|
Posted: Sun Aug 10, 2008 4:44 am Post subject: |
|
|
| Code: | int Application_1 = 0;
// Read the config file
int cfg = configOpen("ms0:/SEPlugins/piKey/AppLaunchConfig.txt");
if (cfg >= 0)
{
while (configRead(cfg, cfgtoken, cfgvalue))
{
if (strcmp(cfgtoken, "Application 1") == 0)
{
Application_1 = (cfgvalue); //LINE AFFECTED
}
}
}
//EBOOT 1
if (isKeyPressed(KEY_1) && ctrl && alt){
displayStatusText("Loading Application 1...");
sceKernelDelayThread(3 * 1000 * 1000);
Load_EBOOT(Application_1); //LINE AFFECTED
} |
After studying Dark_AleX's code, I still don't get it! Looks all very complex!
I need to do more researh and work so I get this!
Last edited by angelo on Sun Aug 10, 2008 5:54 am; edited 1 time in total |
|
| Back to top |
|
 |
Raphael

Joined: 17 Jan 2006 Posts: 646 Location: Germany
|
Posted: Sun Aug 10, 2008 4:55 am Post subject: |
|
|
| Quote: | | int Application_1 = 0; |
... this is supposed to be a char*, if anything at all. _________________ <Don't push the river, it flows.>
http://wordpress.fx-world.org - my devblog
http://wiki.fx-world.org - VFPU documentation wiki
Alexander Berl |
|
| Back to top |
|
 |
angelo
Joined: 29 Aug 2007 Posts: 168
|
Posted: Sun Aug 10, 2008 5:59 am Post subject: |
|
|
Ok... I tried that!
| Code: | // Read the config file
int cfg = configOpen("ms0:/SEPlugins/piKey/AppLaunchConfig.txt");
if (cfg >= 0)
{
while (configRead(cfg, cfgtoken, cfgvalue))
{
if (strcmp(cfgtoken, "Application 1") == 0)
{
Application_1 = (cfgvalue); //LINE AFFECTED
}
}
}
//EBOOT 1
if (isKeyPressed(KEY_1) && ctrl && alt){
displayStatusText("Loading Application 1...");
sceKernelDelayThread(3 * 1000 * 1000);
Load_EBOOT(Application_1); //LINE AFFECTED
} |
This time, no errors when compiling, but now my PSP just freezes when I try a boot a game.
Here's the config file:
| Code: | | Application 1 = "ms0:/SEPlugins/piKey/Applications/App1/EBOOT.PBP" |
I'm confused as to what's going wrong... |
|
| Back to top |
|
 |
J.F.
Joined: 22 Feb 2004 Posts: 2906
|
Posted: Sun Aug 10, 2008 6:22 am Post subject: |
|
|
Are you closing the config file? Might not be your problem, but it's certainly something you should be doing.
Also, cfgvalue is a char array. Is (cfgvalue) a char*? I'd be using &cfgvalue there. |
|
| Back to top |
|
 |
angelo
Joined: 29 Aug 2007 Posts: 168
|
Posted: Sun Aug 10, 2008 8:48 am Post subject: |
|
|
Smart thinking there J.F! Hey why don't you join the team?! XD Hehe!
I'll try it in the morning, it's nealry 12:00 am here and I'm typing on my Targus
Thanks guys! I'll let you all know how it goes! |
|
| Back to top |
|
 |
J.F.
Joined: 22 Feb 2004 Posts: 2906
|
Posted: Sun Aug 10, 2008 9:41 am Post subject: |
|
|
| angelo wrote: | Smart thinking there J.F! Hey why don't you join the team?! XD Hehe!
|
<Arnold Voice>You very funny guy - that why I kill you last.</Arnold Voice> |
|
| Back to top |
|
 |
jean

Joined: 05 Jan 2008 Posts: 489
|
Posted: Sun Aug 10, 2008 10:37 am Post subject: |
|
|
..........
i can hear voices from the past screaming "no noob question here"....then all turns black. But it's all envy since i didn't get invited to "THE TEAM", too.....omg,wtf.... |
|
| Back to top |
|
 |
|