GXInitFifoBase

C Specification

#include <revolution/gx.h>
void GXInitFifoBase(
    GXFifoObj* fifo, 
    void*      base, 
    u32        size);

Arguments

fifo A pointer to the FIFO structure
base A pointer to the 32-byte aligned MEM1 memory to use for the FIFO.
size The FIFO size in 32-byte multiples. The minimum size is 64KB (GX_FIFO_MINSIZE).

Return Values

None.

Description

This function sets up the main memory to be used for the graphics FIFO in the fifo structure. The FIFO base pointer base must be 32-byte aligned. The size size must also be a multiple of 32B and have a value greater than 64KB defined by GX_FIFO_MINSIZE.

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

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

The CPU's write-gather pipe is used to write data to the FIFO. Therefore, the FIFO memory area must be forced out of the CPU cache prior to use. The DCInvalidateRange function may be used for this purpose. 

The GXInit function initializes the FIFO based on the arguments base and size and attaches the FIFO to both the CPU and GP. Therefore, it is not necessary to call GXInitFifoBase unless you want to resize the default FIFO sometime after GXInit has been called or if you are creating a new FIFO.

Since the GXInitFifoBase function initializes the read pointer and write pointer to the same value as base, it is not normally needed to call the GXInitFifoPtrs function when initializing the FIFO. In addition, GXInitFifoBase sets the FIFO's high watermark to (size-16KB) and the low water mark to (size/2), so it's not necessary to call GXInitFifoLimits unless you want to use special settings.

See Also

GXInitFifoPtrs
GXInitFifoLimits

Revision History

2006/03/01 Initial version.


CONFIDENTIAL