Sets the fade for the VI screen
#include <ultra64.h> /* os.h */ void osViFade(u8 active, u16 factor);
osViFade enables you to perform fade-out processing of solid-color screens by changing the interpolation coefficient.
When any value other than 0 is set in active to enable fading, the colors of the first and second lines in the frame buffer are taken and interpolated at the ratio specified by factor, and then embedded in the screen at that color.
To show this in a concrete equation, where the RGB value of the first line is (r1,g1,b1), that of the second line is (r2,g2,b2), and the coefficient f=(factor/0x3ff),
(R,G,B) = ((r1*(1-f)+r2*f),(g1*(1-f)+g2*f),(b1*(1-f)+ b2*f))
becomes the fill color.
osViFade can be used low resolution, point sampling, and noninterlaced modes (LPN1, LPN2, etc.).
When fading is enabled, fading must be returned to disabled before a PreNMI occurs or before executing osViBlack.
02/01/99 Completely rewritten.