hsync counter?
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?
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
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".
i only used the VR-interrupt, but HR shouldn't be that different
Code: Select all
void vrStartHandler(u32 cause)
{
vrcounter++;
}
//-----------------------------------------------
void install_vrStartHandler(void)
{
asm volatile ("di");
AddIntcHandler(2, vrStartHandler, 0);
EnableIntc(2);
asm volatile ("ei");
}
or you could use one of the 4 timers on the EE, and tell it to count "H-BLNKs".
infj
Check out my blurb on EE timers: EE Timers
The enum:
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.
The enum:
Code: Select all
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
};
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.