hey..im writing my own pause function..this is what i wrote..seems like it should work to me at least..
void pgPause(unsigned long p)
{
struct timeval curT;
unsigned long startTime, endTime,curTime;
sceKernelLibcGettimeofday(curT,0);
startTime = (curT.tv_sec*1000000) + curT.tv_usec;
endTime=startTime+p;
while(curTime<endTime)
{
sceKernelLibcGettimeofday(curT,0);
curTime=(curT.tv_sec*1000000)+curT.tv_usec;
}
}
however, the psp freezes up..? help?
pause function
Code: Select all
int sceKernelDelayThread(unsigned int usecs);
The PSP's kernel uses a cooperative scheduler, so you have to deliberately yield your thread in order for other threads to execute. Your method blocks the CPU.
-
- Posts: 82
- Joined: Mon Jun 20, 2005 3:32 am
well, im trying to "pause" a while loop..
like i have something like this
while(condition)
{
dosomethingcool();
wait(100 milliseconds);
}
i wanted it to so i can pause between each "step" in a while loop
if i sleep the thread..the while loop still goes, but the psp fucntions just stop..so only some of the "dosomethingcool" get put to the screen..
like i have something like this
while(condition)
{
dosomethingcool();
wait(100 milliseconds);
}
i wanted it to so i can pause between each "step" in a while loop
if i sleep the thread..the while loop still goes, but the psp fucntions just stop..so only some of the "dosomethingcool" get put to the screen..
-
- Posts: 82
- Joined: Mon Jun 20, 2005 3:32 am