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 

pausing execution

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



Joined: 27 Jan 2005
Posts: 36

PostPosted: Thu Jan 27, 2005 8:59 am    Post subject: pausing execution Reply with quote

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
View user's profile Send private message
Lousyphreak



Joined: 25 Jan 2005
Posts: 6

PostPosted: Thu Jan 27, 2005 9:04 am    Post subject: Reply with quote

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
View user's profile Send private message
Mak0



Joined: 27 Jan 2005
Posts: 36

PostPosted: Thu Jan 27, 2005 9:56 am    Post subject: Reply with quote

wow i guess its not as simple as I hoped. theres nothing like a simple int pause() function?
Back to top
View user's profile Send private message
Drakonite
Site Admin


Joined: 17 Jan 2004
Posts: 989

PostPosted: Thu Jan 27, 2005 5:16 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 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