gDPSetFillColor [macro]
Sets the RDP fill color.
Syntax
#include <ultra64.h> /* gbi.h */
gDPSetFillColor(Gfx *gdl, u32 c)
gsDPSetFillColor(u32 c)
Arguments
- gdl is the display list pointer.
- c is the 32-bit color value.
Explanation
Sets the RDP fill color. The fill color is an internal color register of the memory interface (MI) in the RDP. 32-bit fill color is only used in fill mode. Because data is written at a rate of 64 bits per clock in fill mode, the 32-bit color data is written twice, 2 pixels each time, to make a block of 4 pixels (a 32-bit fill color composition of two different 16-bit pixels can be used for a "special effect"). To learn how to set the cycle type, see gDPSetCycleType. For details, see Section 12.8.2, "Fill Color," in the N64 Online Programming Manual.
Notes
g*DPSetFillColor is used primarily to clear the color frame buffer and the Z buffer. To clear the Z buffer, first set the Z buffer address to the color frame buffer address and then execute the command.
Cautions
Two color-packing macros are available to fill the color frame buffer and the Z buffer. GPACK_RGBA5551 (r,g,b,a) and GPACK_ZD (z,dz) clear these respective buffers by packing them with 16-bit color. The maximum Z buffer value is G_MAXFBZ (0x3fff). Both macros return 16 bits and generate a 32-bit fill color the second time they are used.
Example
To fill the color frame buffer with red, you would use the following:
gDPSetFillColor(gp++, GPACK_RGBA5551(255,0,0,1)<<16 |
GPACK_RGBA5551(255,0,0,1));
Clearing the Z buffer with the maximum value looks like this:
gDPSetFillColor(gp++, GPACK_ZDZ(G_MAXFBZ, 0)<<16 |
GPACK_ZDZ(G_MAXFBZ, 0));
See Also
gDPFillRectangle
gDPSetAlphaCompare
gDPSetCombineMode
gDPSetCycleType
gDPSetRenderMode
Revision History
2/1/99 Completely rewritten.
|
Nintendo® Confidential
Warning: all information in this document is confidential and covered by a non-disclosure agreement. You are responsible for keeping this information confidential and protected. Nintendo will vigorously enforce this responsibility.
Copyright © 1998-1999
Nintendo of America Inc. All rights reserved Nintendo and N64 are registered trademarks of Nintendo
Last Updated April, 1999
|