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 

Variable argument problem

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



Joined: 01 Feb 2006
Posts: 26
Location: Sydney

PostPosted: Sat Feb 11, 2006 5:28 pm    Post subject: Variable argument problem Reply with quote

I'm have some trouble passing parameter to functions that accept, variable arguments i.e.

Code:

draw(SceSize args, void * argp)


This code is required for starting threads i.e.

Code:


void draw(SceSize args, void * argp)
{
     while (1)
     {
           // print argument list
           sceKernelDelayThread(1000000);           
     }
           
     return(0);
}
 
void function_1(void)
{
    int _tId = sceKernelCreateThread("DrawThread", draw, 0x18, 0x10000, 0, 0);   
    sceKernelStartThread(_tId, 0, NULL);
}


I cannot work out the code for passing parameters, i have tried so many things but nothing works.

Could someone please help or give me example that works... I have spend too much time on this and hoping some people here could help.

Please I'm at point of giving up but need this code to generically handle my game threads.
Back to top
View user's profile Send private message
jimparis



Joined: 10 Jun 2005
Posts: 1179
Location: Boston

PostPosted: Sat Feb 11, 2006 5:45 pm    Post subject: Re: Variable argument problem Reply with quote

ipsp wrote:
Could someone please help or give me example that works...
Look at how the SDL code does it (src/thread/psp/SDL_systhread.c).

Quote:
Please I'm at point of giving up but need this code to generically handle my game threads.
Why not just use a standard library like SDL? It's well-documented and there's plenty of example code out there.
Back to top
View user's profile Send private message
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