Help drawing objects from a prx

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

Moderators: cheriff, TyRaNiD

Post Reply
coolkehon
Posts: 355
Joined: Mon Oct 20, 2008 5:44 am

Help drawing objects from a prx

Post by coolkehon »

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
User avatar
Torch
Posts: 825
Joined: Wed May 28, 2008 2:50 am

Re: Help drawing objects from a prx

Post by Torch »

You can use semaphores to coordinate between different executables.
http://www.kernsafe.com/TechDocs/pspsdk ... an_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.
coolkehon
Posts: 355
Joined: Mon Oct 20, 2008 5:44 am

Post by coolkehon »

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
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

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.
Post Reply