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 

hsync counter?

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



Joined: 27 Apr 2005
Posts: 75
Location: Texas USA

PostPosted: Tue May 24, 2005 5:46 am    Post subject: hsync counter? Reply with quote

I read somewhere that the hsync count (or line count) can be used to tell how far into the frame processing a process is and that PS2 makes this available. I can't find it in the docs. Do I need to set up my own hsync call back counter or is hsync count already in the SDK?
Back to top
View user's profile Send private message
Saotome



Joined: 03 Apr 2004
Posts: 182

PostPosted: Tue May 24, 2005 6:11 am    Post subject: Reply with quote

actually thats pretty simple, its not worth to implement special functions for that in the SDK ;)

i only used the VR-interrupt, but HR shouldn't be that different
Code:

void vrStartHandler(u32 cause)
{
   vrcounter++;
}
//-----------------------------------------------
void install_vrStartHandler(void)
{
   asm volatile ("di");
   
   AddIntcHandler(2, vrStartHandler, 0);
   EnableIntc(2);

   asm volatile ("ei");
}

for hsync you have to replace the "2" with some other value, dont know which (2 is for vrStart, 3 is for vrEnd - maybe 0 or 1 or >2?).

or you could use one of the 4 timers on the EE, and tell it to count "H-BLNKs".
_________________
infj
Back to top
View user's profile Send private message
shawn_t



Joined: 26 Jul 2005
Posts: 11

PostPosted: Thu Aug 04, 2005 2:02 pm    Post subject: Reply with quote

Check out my blurb on EE timers: EE Timers

The enum:

Code:

enum
{
   kINTC_GS,
   kINTC_SBUS,
   kINTC_VBLANK_START,
   kINTC_VBLANK_END,
   kINTC_VIF0,
   kINTC_VIF1,
   kINTC_VU0,
   kINTC_VU1,
   kINTC_IPU,
   kINTC_TIMER0,
   kINTC_TIMER1
};


enumerates the interrupts. I'm not familiar with an interrupt for an H-BLNK, but as mentioned, you can easily set up any of the EE timers to count H-BLNKS.

If you still don't understand how to set it up for counting H-BLNK's, then let me know and I'll explain it.
Back to top
View user's profile Send private message
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