1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html>
3
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
6<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
7<meta http-equiv="Content-Style-Type" content="text/css">
8<link rel="stylesheet" type="text/css" href="../CSS/revolution.css">
9<title>VISetPreRetraceCallback</title>
10</head>
11
12<body>
13
14<h1 align="left">VISetPreRetraceCallback</h1>
15
16<h2>Syntax</h2>
17<dl><dd><pre class="construction">#include &lt;revolution/vi.h&gt;
18
19typedef void (*VIRetraceCallback)(u32 retraceCount);
20
21VIRetraceCallback VISetPreRetraceCallback(VIRetraceCallback callback);
22</pre></dd></dl>
23
24<h2>Arguments</h2>
25<TABLE class="arguments" border="1" >
26<TBODY>
27  <tr>
28<th>callback</th>
29<td>A pointer to the pre-retrace callback function.</td>
30  </tr>
31</TBODY>
32</table>
33
34<h2>Return Values</h2>
35<p>Pointer to the previous callback function.</p>
36
37<h2>Description</h2>
38<p>This function sets the pre-retrace callback. That callback is a function called before VI device driver's retrace interrupt handler sets the VI registers. VI functions can therefore be called that change modes, image position, size, and so on, just in time for the next field. The retrace count of the next field is passed as the argument of the pre-retrace callback function.</p>
39
40<p>It returns the pointer to the previous callback function.</p>
41
42<p>Specifying <CODE>NULL</CODE> for <SPAN class="argument">callback</SPAN> means no callback is specified as the pre-retrace callback. Similarly, <CODE>NULL</CODE> is returned when no callback has been registered before. Since no callback is specified by default, the first call to this function should return <CODE>NULL</CODE>. You can cancel a callback function you set previously by specifying <CODE>NULL</CODE> for <SPAN class="argument">callback</SPAN>.</p>
43
44<p>The retrace count, which is passed to the callback function as an argument, is incremented once every 1/60 second in NTSC/EURGB60 modes (or once every 1/50 second in PAL mode).</p>
45
46<p>Because setting the VI registers in every frame (by the interrupt handler of the VI device driver) is a time critical operation, the processing of pre-retrace callbacks should be minimized. If there is something to be done for every retrace timing that has nothing to do with VI register settings, those tasks should be processed not with a pre-retrace callback but with a post-retrace callback.</p>
47
48<h2>See Also</h2>
49<P class="reference">
50<a href="VISetPostRetraceCallback.html">VISetPostRetraceCallback</a>,
51<a href="VIWaitForRetrace.html">VIWaitForRetrace</a>
52</p>
53
54<h2>Revision History</h2>
55<p>
562007/12/03 Deleted the MPAL description.<br>2006/03/01 Initial version.<br>
57</p>
58
59<hr><p>CONFIDENTIAL</p></body>
60</html>