| View previous topic :: View next topic |
| Author |
Message |
coolkehon
Joined: 20 Oct 2008 Posts: 355
|
Posted: Fri Jan 16, 2009 10:55 pm Post subject: Help drawing objects from a prx |
|
|
| i have a main eboot.pbp that does the drawing but i also have prx's that act as sub programs how can i have the prx draw when the main eboot draws to have objects draw |
|
| Back to top |
|
 |
Torch

Joined: 28 May 2008 Posts: 842
|
Posted: Sat Jan 17, 2009 12:16 am Post subject: Re: Help drawing objects from a prx |
|
|
You can use semaphores to coordinate between different executables.
http://www.kernsafe.com/TechDocs/pspsdk/pspthreadman_8h.html
Lock the semaphore in the eboot thread. Make the prx wait until the semaphore is released to do its drawing, etc. When the eboot needs to tell the prx to draw, unlock the semaphore.
You create the semaphore in the eboot with a unique name. Then you will need to find the semaphore in the prx to check if its locked. Use sceKernelGetThreadmanIdList to list the semaphores and find the one with the name you want.
If speed is not of importance, you can export a function from the prx, and call it from your eboot thread when you need to tell it when to draw. |
|
| Back to top |
|
 |
coolkehon
Joined: 20 Oct 2008 Posts: 355
|
Posted: Sat Jan 17, 2009 1:51 am Post subject: |
|
|
| that not the problem i need to be able to draw from the prx i'm using oslib it crashes when doing so but i think i may send the prx the function pointers to call to draw from because i'm using a drawingcanvas that has a vector of drawings and i cant load images either its the images that have the problem any reason why |
|
| Back to top |
|
 |
J.F.
Joined: 22 Feb 2004 Posts: 2906
|
Posted: Sat Jan 17, 2009 8:06 am Post subject: |
|
|
| It's because a prx cannot (yet) import or export anything other than function pointers. Any reference to ANYTHING used must be passed as an argument to the function called. That makes things like many libc functions unusable as they reference things in the EBOOT implicitly. For example, say you define an int called x in the EBOOT. The prx cannot do "y = x <<8;" as it has no idea what or where "x" is. You'd have to pass &x through to the function and do "y = *passed_x_ptr <<8;" to get around that. |
|
| Back to top |
|
 |
|