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 

Help drawing objects from a prx

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



Joined: 20 Oct 2008
Posts: 355

PostPosted: Fri Jan 16, 2009 10:55 pm    Post subject: Help drawing objects from a prx Reply with quote

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
View user's profile Send private message MSN Messenger
Torch



Joined: 28 May 2008
Posts: 842

PostPosted: Sat Jan 17, 2009 12:16 am    Post subject: Re: Help drawing objects from a prx Reply with quote

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
View user's profile Send private message
coolkehon



Joined: 20 Oct 2008
Posts: 355

PostPosted: Sat Jan 17, 2009 1:51 am    Post subject: Reply with quote

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



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Sat Jan 17, 2009 8:06 am    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
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