VISetPreRetraceCallback

C Specification

#include <revolution/vi.h>
typedef void (*VIRetraceCallback)(u32 retraceCount);
VIRetraceCallback VISetPreRetraceCallback(VIRetraceCallback callback)

Arguments

callback A pointer to the pre-retrace callback function

Return Values

Pointer to the previous callback function.

Description

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.

It returns the pointer to the previous callback function.

Specifying NULL for callback means no callback is specified as the pre-retrace callback. Similarly, NULL is returned when no callback is specified before. Since no callback is specified by default, the first call to this function should return NULL. You can cancel a callback you set previously by specifying NULL for callback.

The retrace count, which is passed to the argument of the callback function, is incremented once every 1/60 second in NTSC/MPAL/EURGB60 modes (or once every 1/50 second in PAL mode).

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.

See Also

VISetPostRetraceCallback, VIWaitForRetrace

Revision History

2006/03/01 Initial version.


CONFIDENTIAL