Variable argument problem

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

Moderators: cheriff, TyRaNiD

Post Reply
ipsp
Posts: 26
Joined: Wed Feb 01, 2006 9:46 am
Location: Sydney

Variable argument problem

Post by ipsp »

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

Code: Select all

draw(SceSize args, void * argp)
This code is required for starting threads i.e.

Code: Select all


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.
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Re: Variable argument problem

Post by jimparis »

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