| View previous topic :: View next topic |
| Author |
Message |
Beuc
Joined: 26 Mar 2009 Posts: 33 Location: holland
|
Posted: Mon Apr 13, 2009 7:17 am Post subject: [Solved] Running a homebrew from a homebrew |
|
|
Hi,
I'd like to run my FreeDink(.org) homebrew with some additional parameters, so it can run a given addon instead of the main game. In another words I need to write a simple frontend to do the job.
What's the best way to run the game engine from the frontend - that is, run an homebrew from another one? In the psplink code I found that "ldstart" is implemented using "sceKernelLoadModule", but I'm not sure that's what I need.
Last edited by Beuc on Fri Apr 17, 2009 6:21 am; edited 1 time in total |
|
| Back to top |
|
 |
arnie
Joined: 11 Apr 2009 Posts: 16
|
Posted: Mon Apr 13, 2009 9:31 am Post subject: |
|
|
| Code: |
int k1 = pspSdkSetK1(0);
SceUID mod = sceKernelLoadModule(path, 0, NULL);
if (mod >= 0)
{
mod = sceKernelStartModule(mod, 0, NULL, NULL, NULL);
if (mod < 0)
//Error
}
pspSdkSetK1(k1);
|
Replace path with the module you want to load.
-Arnie |
|
| Back to top |
|
 |
Beuc
Joined: 26 Mar 2009 Posts: 33 Location: holland
|
Posted: Tue Apr 14, 2009 2:39 am Post subject: |
|
|
| arnie wrote: | | Code: |
int k1 = pspSdkSetK1(0);
SceUID mod = sceKernelLoadModule(path, 0, NULL);
if (mod >= 0)
{
mod = sceKernelStartModule(mod, 0, NULL, NULL, NULL);
if (mod < 0)
//Error
}
pspSdkSetK1(k1);
|
Replace path with the module you want to load.
-Arnie |
It looks it doesn't want to start the application if the front-end is already running (mod == 0x800200d9). Do I need to unload it first somehow?
I tried with running an eboot (0x80020148/unsupported_prx_type) and a .prx (0x800200D9/same as when trying to run a program twice from psplink).
I'm not very familiar with the PSP constraints (like, you can run two programs at once?).
Thanks! |
|
| Back to top |
|
 |
Beuc
Joined: 26 Mar 2009 Posts: 33 Location: holland
|
Posted: Tue Apr 14, 2009 6:58 am Post subject: |
|
|
OK, apparently something going wrong (800200d9) if I run an SDL app from another SDL app - even if I unloaded everything:
Works:
- run text-mode app 1
- user chooses app to launch
- call pspSdkLoadStartModule(SDL App 2)
- SDL App 2 is run
Doesn't work:
- run SDL app 1
- user chooses app to launch (graphically)
- quit SDL
- call pspSdkLoadStartModule(SDL App 2)
- SDL App 2 is not run (800200d9)
Do you have an idea about what blocks starting SDL App 2 from SDL App 1? |
|
| Back to top |
|
 |
Torch

Joined: 28 May 2008 Posts: 842
|
Posted: Tue Apr 14, 2009 7:42 am Post subject: |
|
|
800200d9 in loadmodule means non enough memory to load.
You probably haven't freed the heap. |
|
| Back to top |
|
 |
Beuc
Joined: 26 Mar 2009 Posts: 33 Location: holland
|
Posted: Tue Apr 14, 2009 7:52 am Post subject: |
|
|
Thanks - what function should I use to free the heap?
I didn't manipulate it directly. |
|
| Back to top |
|
 |
Beuc
Joined: 26 Mar 2009 Posts: 33 Location: holland
|
Posted: Tue Apr 14, 2009 8:40 am Post subject: |
|
|
I confirm that the heap is not freed - sadly __psp_free_heap() doesn't seem to be public, and it's the only function with access to the memory blockid used by newlib AFAICS.
Is there another way? |
|
| Back to top |
|
 |
Torch

Joined: 28 May 2008 Posts: 842
|
Posted: Tue Apr 14, 2009 1:57 pm Post subject: |
|
|
| Simply add the prototype for it in your source and it will work. |
|
| Back to top |
|
 |
Beuc
Joined: 26 Mar 2009 Posts: 33 Location: holland
|
Posted: Wed Apr 15, 2009 3:24 am Post subject: |
|
|
| Torch wrote: | | Simply add the prototype for it in your source and it will work. |
Cool. I did but actually I had forgotten an "extern C" somewhere (I'm using Guichan so the program is C++), hence I thought I didn't work. It works fine now - only using '__' functions is probably a bit ugly.
Thanks :) |
|
| Back to top |
|
 |
|