pausing execution
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?
			
			
									
									
						- 
				Lousyphreak
- Posts: 6
- Joined: Tue Jan 25, 2005 5:28 pm
dont know if it helps but this is taken straight from the scummvm port im working on:
			
			
									
									
						Code: Select all
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();    
 }
 
}
You could also use the EE performance counters or use vsyncs...
i.e.
			
			
									
									i.e.
Code: Select all
#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
						Makeshift Development
