| View previous topic :: View next topic |
| Author |
Message |
Mak0
Joined: 27 Jan 2005 Posts: 36
|
Posted: Thu Jan 27, 2005 8:59 am Post subject: pausing execution |
|
|
| sorry for the really basic question but what would be the best method for pausing execution for, I dont know, say 3 seconds? |
|
| Back to top |
|
 |
Lousyphreak
Joined: 25 Jan 2005 Posts: 6
|
Posted: Thu Jan 27, 2005 9:04 am Post subject: |
|
|
dont know if it helps but this is taken straight from the scummvm port im working on:
| Code: | uint32 getMillis()
{
int* sec;
int* usec;
SifCallRpc(&client,0,0,(void*)(&rpcBuffer[0]),0,(void*)(&rpcBuffer[0]),128,0,0);
sec = (int*) (&rpcBuffer[0]);
usec = (int*) (&rpcBuffer[4]);
msecs = (*sec)*1000+ (*usec)/1000;
return msecs;
}
void delayMillis(uint msecs_time)
{
uint32 i = getMillis();
uint32 time = i;
while (time <= i+msecs_time) {
checkSound();
time= getMillis();
}
}
|
|
|
| Back to top |
|
 |
Mak0
Joined: 27 Jan 2005 Posts: 36
|
Posted: Thu Jan 27, 2005 9:56 am Post subject: |
|
|
| wow i guess its not as simple as I hoped. theres nothing like a simple int pause() function? |
|
| Back to top |
|
 |
Drakonite Site Admin

Joined: 17 Jan 2004 Posts: 989
|
Posted: Thu Jan 27, 2005 5:16 pm Post subject: |
|
|
You could also use the EE performance counters or use vsyncs...
i.e.
| Code: |
#define VSYNCS_PER_FRAME 60 // NTSC, you should really do detection...
for(wait=0;wait<3*VSYNCS_PER_FRAME;wait++)
VSync() //replace this with a real vsync function...
|
_________________ Shoot Pixels Not People!
Makeshift Development |
|
| Back to top |
|
 |
|