GXSetGPFifo

C Specification

#include <revolution/gx.h>
void GXSetGPFifo( const GXFifoObj* fifo );

Arguments

fifo A pointer to the FIFO structure

Return Values

None.

Description

This function attaches a FIFO to the GP. The GP calls commands from the FIFO and executes them sequentially. If the same FIFO is connected to the CPU using GXSetCPUFifo, the FIFO will be an immediate mode interface used for drawing graphics. Conversely, separating the FIFO used to connect to the CPU from the FIFO used to connect to the GP allows a frame's worth of graphics commands to be accumulated for use.

The GXInit function initializes the default FIFO and sets it up as an immediate mode graphics interface.

The fifo structure must be initialized before calling GXSetGPFifo using GXInitFifoBase, GXInitFifoLimits, and GXInitFifoPtrs. After configuring by calling GXSetCPUFifo, there is no need to keep the contents of the fifo structure.

The FIFO region must be allocated in internal memory (MEM1 region) of the system.

Note: The external memory (MEM2 region) cannot be allocated.

Immediate Mode

When a FIFO is attached to both the CPU and GP, the FIFO acts as a true FIFO buffer. In this mode, the high and low watermarks function and flow control is enabled between the CPU and GP. The CPU stops writing graphics commands to the FIFO if the volume of commands accumulating in the FIFO exceeds the high water mark. The CPU resumes sending graphics commands to the FIFO after the GP catches up and the volume of commands accumulating in the FIFO falls below the low watermark. These watermark settings can be established using GXInitFifoLimits. The high watermark is set to [(FIFO size) - GX_FIFO_HI_WATERMARK_BUFFER] at the point where the FIFO structure is initialized using GXInitFifoBase. GX_FIFO_HI_WATERMARK_BUFFER is defined as 16KB. The low watermark is set to be half of the FIFO size. 

Multi-Buffered FIFOs

The FIFO functions as a fixed command list when it is connected only to the GP. If a FIFO containing commands is connected to the GP, it will be read until empty. Before attaching a new FIFO to the GP, you should make sure the previous FIFO is empty, using the cmdIdle status returned by GXGetGPStatus.

See Also

GXSetCPUFifo

Revision History

2006/03/01 Initial version.


CONFIDENTIAL