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>GXInitFifoBase</title>
10</head>
11
12<body>
13
14<h1 align="left">GXInitFifoBase</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 GXInitFifoBase(
23<a href="../Structures/GXFifoObj.html">GXFifoObj</a>*  fifo,
24void*      base,
25u32                 size);</CODE></pre>
26  </dd>
27</dl>
28
29<h2>Arguments</h2>
30<div align="left">
31<TABLE border="1" cellpadding="3" cellspacing="0.1">
32  <tr>
33<TD width="120" bgcolor="#ffffe8"><code><strong><em>fifo</em></strong></code></TD>
34<TD width="520">A pointer to the FIFO structure</TD>
35    </tr>
36  <tr>
37<TD width="120" bgcolor="#ffffe8"><code><strong><em>base</em></strong></code></TD>
38<TD width="520">A pointer to the 32-byte aligned MEM1 memory to use for the FIFO.</TD>
39    </tr>
40  <tr>
41<TD width="120" bgcolor="#ffffe8"><code><strong><em>size</em></strong></code></TD>
42<TD width="520">The FIFO size in 32-byte multiples. The minimum size is 64KB (<code>GX_FIFO_MINSIZE</code>).</TD>
43    </tr>
44</TABLE>
45</div>
46
47<h2>Return Values</h2>
48
49<p>None.</p>
50<H2>Description</H2>
51<P>This function sets up the main memory to be used for the graphics FIFO in the <EM><STRONG><CODE>fifo</CODE></STRONG></EM> structure. The FIFO base pointer <code><em><strong>base</strong></em></code> must be 32-byte aligned. The size <CODE><EM><STRONG>size</STRONG></EM></CODE> must also be a multiple of 32B and have a value greater than 64KB defined by <CODE>GX_FIFO_MINSIZE</CODE>. </P>
52
53<P>The FIFO region must be allocated in internal memory (MEM1 region) of the system.<BR><BR><B>Note:</B> The external memory (MEM2 region) cannot be allocated.</P>
54
55<P>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 <A href="../../os/Cache/DCInvalidateRange.html"><code>DCInvalidateRange</code></a> function may be used for this purpose.&nbsp;</P>
56
57<P>The <a href="../Management/GXInit.html"><code>GXInit</code></a> function initializes the FIFO based on the arguments <code><em><strong>base</strong></em></code> and <code><em><strong>size</strong></em></code> and attaches the FIFO to both the CPU and GP. Therefore, it is not necessary to call <code>GXInitFifoBase</code> unless you want to resize the default FIFO sometime after <a href="../Management/GXInit.html"><code>GXInit</code></a> has been called or if you are creating a new FIFO. </P>
58
59
60
61<P>Since the <CODE>GXInitFifoBase</CODE> function initializes the read pointer and write pointer to the same value as <EM><STRONG><CODE>base</CODE></STRONG></EM>, it is not normally needed to call the <CODE><A href="GXInitFifoPtrs.html">GXInitFifoPtrs</A></CODE> function when initializing the FIFO. In addition, <code>GXInitFifoBase</code> sets the FIFO's high watermark to (<code><em><strong>size</strong></em></code>-16KB) and the low water mark to (<code><em><strong>size</strong></em></code>/2), so it's not necessary to call <a href="GXInitFifoLimits.html"><code>GXInitFifoLimits</code></a> unless you want to use special settings.</P>
62
63
64<h2>See Also</h2>
65<P><a href="GXInitFifoPtrs.html">GXInitFifoPtrs</a><br> <a href="GXInitFifoLimits.html">GXInitFifoLimits</a></P>
66<H2>Revision History</H2>
67<P>03/01/2006 Initial version.</P>
68</BODY>
69</HTML>