1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html>
3
4<head>
5<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
6<META name="GENERATOR" content="Microsoft FrontPage 5.0">
7<META http-equiv="Content-Style-Type" content="text/css">
8<LINK rel="stylesheet" type="text/css" href="../../CSS/revolution.css">
9<title>GXSetGPFifo</title>
10</head>
11
12<body>
13
14<h1 align="left">GXSetGPFifo</h1>
15
16
17<h2>C Specification</h2>
18
19<dl>
20  <dd><PRE><CODE>#include &lt;revolution/gx.h&gt;</CODE></PRE>
21  </dd>
22  <dd><pre><CODE>void GXSetGPFifo( const <a href="../Structures/GXFifoObj.html">GXFifoObj</a>* fifo );</CODE></pre>
23  </dd>
24</dl>
25
26<h2>Arguments</h2>
27<div align="left">
28<TABLE border="1" cellpadding="3" cellspacing="0.1">
29  <tr>
30<TD width="120" bgcolor="#ffffe8"><code><strong><em>fifo</em></strong></code></TD>
31<TD width="520">A pointer to the FIFO structure</TD>
32    </tr>
33</TABLE>
34</div>
35
36<h2>Return Values</h2>
37
38<p>None.</p>
39<H2>Description</H2>
40<P>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 <A href="GXSetCPUFifo.html"><CODE>GXSetCPUFifo</CODE></A>, 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. </P>
41<P>The <A href="../Management/GXInit.html"><CODE>GXInit</CODE></A> function initializes the default FIFO and sets it up as an immediate mode graphics interface. </P>
42<P>The <EM><STRONG><CODE>fifo</CODE></STRONG></EM> structure must be initialized before calling <a href="GXSetCPUFifo.html"><code>GXSetGPFifo</code></a> using <a href="GXInitFifoBase.html"><code>GXInitFifoBase</code></a>, <code><a href="GXInitFifoLimits.html">GXInitFifoLimits</a></code>, and <a href="GXInitFifoPtrs.html"><code>GXInitFifoPtrs</code></a>. After configuring by calling <A href="GXSetCPUFifo.html"><CODE>GXSetCPUFifo</CODE></A>, there is no need to keep the contents of the <EM><STRONG><CODE>fifo</CODE></STRONG></EM> structure.</P>
43
44<P>The FIFO region must be allocated in internal memory (MEM1 region) of the system.<BR><BR><B>Note: The external memory (MEM2 region) cannot be allocated.</B></P>
45
46<H3>Immediate Mode</H3>
47<P>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 <A href="GXInitFifoLimits.html"><CODE>GXInitFifoLimits</CODE></A>. The high watermark is set to <CODE>[(FIFO size) - GX_FIFO_HI_WATERMARK_BUFFER]</CODE> at the point where the FIFO structure is initialized using <A href="GXInitFifoBase.html"><CODE>GXInitFifoBase</CODE></A>. <CODE>GX_FIFO_HI_WATERMARK_BUFFER</CODE> is defined as 16KB. The low watermark is set to be half of the FIFO size.&nbsp;
48</P>
49
50<H3>Multi-Buffered FIFOs</H3>
51<P>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 <em><strong><code>cmdIdle</code></strong></em> status returned by <a href="GXGetGPStatus.html"><code>GXGetGPStatus</code></a>.</P>
52
53
54
55<h2>See Also</h2>
56<P><A href="GXSetCPUFifo.html"><CODE>GXSetCPUFifo</CODE></A></P>
57<H2>Revision History</H2>
58<P>2006/03/01 Initial version.</P>
59<hr>
60<P>CONFIDENTIAL</p>
61</BODY>
62</HTML>