 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
Steve F
Joined: 27 Apr 2005 Posts: 75 Location: Texas USA
|
Posted: Tue May 24, 2005 5:46 am Post subject: hsync counter? |
|
|
| 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 |
|
 |
Saotome

Joined: 03 Apr 2004 Posts: 182
|
Posted: Tue May 24, 2005 6:11 am Post subject: |
|
|
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 |
|
 |
shawn_t
Joined: 26 Jul 2005 Posts: 11
|
Posted: Thu Aug 04, 2005 2:02 pm Post subject: |
|
|
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 |
|
 |
|
|
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
|