1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<HTML>
3<HEAD>
4<META http-equiv="Content-Type" content="text/html; charset=utf-8">
5<META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 7.0.1.0 for Windows">
6<META http-equiv="Content-Style-Type" content="text/css">
7<TITLE>OS_GetConsoleType</TITLE>
8<LINK rel="stylesheet" href="../../css/nitro.css" type="text/css">
9</HEAD>
10<BODY>
11<H1 align="left">OS_GetConsoleType <IMG src="../../image/NTR.gif" align="middle"><IMG src="../../image/TWL.gif" align="middle"></H1>
12<H2>Syntax</H2>
13<DL>
14<DD><CODE>#include &lt;nitro/os.h&gt;</CODE><BR> <BR> <CODE>u32 OS_GetConsoleType( void );</CODE>
15</DL>
16<H2>Arguments</H2>
17<P>None.</P>
18<H2>Return Values</H2>
19<P>A <code>u32</code>-type value that depends on the program's execution environment. Details are provided in <B>Description</B>.</P>
20<H2>Description</H2>
21<P>Returns a <CODE>u32</CODE>-type value that represents the program's execution environment.</P>
22<P>This function is an effective way to automatically switch processes depending on the operating environment. It allows you to create a common program for multiple operating environments.</P>
23<P><CODE>OS_GetConsoleType</CODE> is a function for <FONT color="#ff0000">getting the <I>operating environment</I></FONT>, not a function for <FONT color="#ff0000">finding out the <I>operating mode</I></FONT>. Use the <A href="OS_IsRunOnTwl.html"><CODE>OS_IsRunOnTwl</CODE></A> function to find out the operating mode. For example, games for NTR can be played on the NTR as well as the TWL. The program is running in NTR mode in either case, but the hardware it is running on is different (NTR or TWL).</P>
24<BLOCKQUOTE>
25<P>・The <A href="OS_IsRunOnTwl.html"><CODE>OS_IsRunOnTwl</CODE></A> function tells you whether the application is running in <B>NTR mode</B> or <B>TWL mode</B>. However, it will not tell you which hardware the application is running on.<BR>With the <CODE>OS_GetConsoleType</CODE> function, you can find out whether the application is running on NTR or TWL. However, it will not tell you what the operating mode is.<BR>(Also, if the FINALROM build of a NITRO-only ROM is run on a TWL, it will return a value that indicates the software is running on NTR.))</P>
26</BLOCKQUOTE>
27<P>The first time it is called, the <CODE>OS_GetConsoleType</CODE> function surveys the devices, memory, and other information to determine its return value, but in subsequent calls, it just returns the same value it returned earlier. As a result, there is hardly any overhead in calling this function.</P>
28<P><FONT color="#ff0000">This function's return values are limited in the FINALROM libraries. When running these builds on something other than the production hardware (such as the debugger), values may be returned that represent environments other than the one being used.</FONT></P>
29<H3><BR><B>Similar Functions</B></H3>
30<P>There is a similar function called <A href="OS_GetRunningConsoleType.html"><CODE>OS_GetRunningConsoleType</CODE></A>. This function is different in that it surveys the actual hardware and returns the appropriate value, even for FINALROM builds.</P>
31<P>For example, this difference can be seen by running a TWL FINALROM build on IS-TWL-DEBUGGER. The IS-TWL-DEBUGGER hardware has 32 MB of built-in memory, so the value returned by the <CODE>OS_GetRunningConsoleType</CODE> function &amp; <CODE>OS_CONSOLE_SIZE_MASK</CODE> is <CODE>OS_CONSOLE_SIZE_32MB</CODE>, and the value returned by the <CODE>OS_GetConsoleType</CODE> function &amp; <CODE>OS_CONSOLE_SIZE_MASK</CODE> is <CODE>OS_CONSOLE_SIZE_16MB</CODE>.</P>
32<P>If either of these functions for getting the operating environment are being left in a FINALROM build, it would be safer to use the <CODE>OS_GetConsoleType</CODE> function instead of the <A href="OS_GetRunningConsoleType.html"><CODE>OS_GetRunningConsoleType</CODE></A> function. The reason is this: Thinking ahead to when this platform is a retail product, the final ROM should only be running on the production hardware, so we want to eliminate the chances of a value that should never occur in the retail product (such as &quot;operating environment is the debugger&quot;) being returned. With that in mind, it would probably be best to limit your use of the <A href="OS_GetRunningConsoleType.html"><CODE>OS_GetRunningConsoleType</CODE></A> function to debugging purposes.</P>
33<H3><BR><B>Values That Can Be Obtained</B></H3>
34<BLOCKQUOTE><B>Operating environment:</B><BR> The bitwise AND of the return value and <CODE>OS_CONSOLE_MASK</CODE> yield the following values depending on the operating environment.<BR>
35<TABLE border="1">
36  <TBODY>
37    <TR>
38<TH>Value</TH>
39<TH>Operating Environment</TH>
40    </TR>
41    <TR>
42<TD width="240"><CODE>OS_CONSOLE_TWL</CODE></TD>
43<TD>Running on TWL hardware (<FONT color="#ff0000"><B>*1</B></FONT>)</TD>
44    </TR>
45    <TR>
46<TD><CODE>OS_CONSOLE_NITRO</CODE></TD>
47<TD>Running on NITRO hardware</TD>
48    </TR>
49    <TR>
50<TD><CODE>OS_CONSOLE_TWLDEBUGGER</CODE></TD>
51<TD>Running on IS-TWL-DEBUGGER (<FONT color="#ff0000"><B>*2</B></FONT>)</TD>
52    </TR>
53    <TR>
54<TD><CODE>OS_CONSOLE_ISDEBUGGER</CODE></TD>
55<TD>Running on IS-NITRO-DEBUGGER</TD>
56    </TR>
57    <TR>
58<TD><CODE>OS_CONSOLE_ENSATA</CODE></TD>
59<TD>Running on Ensata NITRO Software Emulator</TD>
60    </TR>
61  </TBODY>
62</TABLE>
63For <FONT color="#ff0000"><B>*1</B></FONT>, where the function has determined that the application is running on an actual TWL system, the values are further refined based on the bitwise AND in combination with <CODE>OS_CONSOLE_TWLTYPE_MASK</CODE>.<BR>That said, you do not normally have to give consideration to <CODE>OS_CONSOLE_TWLTYPE_DEV</CODE>. Based solely upon <CODE>OS_CONSOLE_TWL</CODE>, you can treat the hardware as an actual TWL system.<BR>When using TWL debugger without connecting to debugger software, the operating environment is <CODE>OS_CONSOLE_TWL</CODE> and the TWL hardware type is <CODE>OS_CONSOLE_TWLTYPE_DEV</CODE>.<BR>However, when using NITRO debugger without connecting to debugger software, the operating environment is <CODE>OS_CONSOLE_IS_DEBUGGER</CODE> (which is no different from being connected to debugger software).
64<TABLE border="1">
65  <TBODY>
66    <TR>
67<TH>Value</TH>
68<TH>TWL Hardware Types</TH>
69    </TR>
70    <TR>
71<TD width="240"><CODE>OS_CONSOLE_TWLTYPE_RETAIL</CODE></TD>
72<TD>TWL retail hardware</TD>
73    </TR>
74    <TR>
75<TD><CODE>OS_CONSOLE_TWLTYPE_DEV</CODE></TD>
76<TD>TWL hardware with a different security key for development purposes / Also indicates no connection to TWL debugger software</TD>
77    </TR>
78  </TBODY>
79</TABLE>
80<BR> For <B><FONT color="#ff0000">*2</FONT></B>, where the function has determined that the application is running on IS-TWL-DEBUGGER, the values are further refined based on the bitwise AND in combination with <CODE>OS_CONSOLE_BOARD_MASK</CODE>.
81<TABLE border="1">
82  <TBODY>
83    <TR>
84<TH>Value</TH>
85<TH>IS-TWL-DEBUGGER Types</TH>
86    </TR>
87    <TR>
88<TD width="240"><CODE>OS_CONSOLE_BOARD_A9_A7</CODE></TD>
89<TD>Debugger that supports both the ARM9 and ARM7, for component development</TD>
90    </TR>
91    <TR>
92<TD><CODE>OS_CONSOLE_BOARD_A9</CODE></TD>
93<TD>ARM9-only debugger, for application development</TD>
94    </TR>
95  </TBODY>
96</TABLE>
97<BR>
98</BLOCKQUOTE>
99<BLOCKQUOTE><B>Devices for Loading Programs:</B><BR> <BR> The bitwise AND of the return value and <CODE>OS_CONSOLE_DEV_MASK</CODE> yield the following values depending on the device loading the program data.
100<TABLE border="1">
101  <TBODY>
102    <TR>
103<TH>Value</TH>
104<TH>Load Device</TH>
105    </TR>
106    <TR>
107<TD width="240"><CODE>OS_CONSOLE_DEV_CARD</CODE></TD>
108<TD>Load from a Game Card device</TD>
109    </TR>
110    <TR>
111<TD><CODE>OS_CONSOLE_DEV_CARTRIDGE</CODE></TD>
112<TD>Load from a Game Pak (<FONT color="#ff0000"><B>*3</B></FONT>)</TD>
113    </TR>
114    <TR>
115<TD><CODE>OS_CONSOLE_DEV_NAND</CODE></TD>
116<TD>Load from NAND</TD>
117    </TR>
118    <TR>
119<TD><CODE>OS_CONSOLE_DEV_SDCARD</CODE></TD>
120<TD>Load from an SD Card</TD>
121    </TR>
122    <TR>
123<TD><CODE>OS_CONSOLE_DEV_MEMORY</CODE></TD>
124<TD>Load from memory</TD>
125    </TR>
126    <TR>
127<TD><CODE>OS_CONSOLE_DEV_DOWNLOAD</CODE></TD>
128<TD>Load from a download</TD>
129    </TR>
130  </TBODY>
131</TABLE>
132<BR> <FONT color="#ff0000"><B>*3</B></FONT> The TWL system does not include a Game Pak slot, so this value cannot be obtained on the TWL platform.<BR>
133</BLOCKQUOTE>
134<BLOCKQUOTE><B>Memory Size:</B><BR> <BR>The bitwise AND of the return value and <CODE>OS_CONSOLE_SIZE_MASK</CODE> takes the following values depending on the size of the implemented memory.
135<TABLE border="1">
136  <TBODY>
137    <TR>
138<TH>Value</TH>
139<TH>Main Memory Size</TH>
140    </TR>
141    <TR>
142<TD width="240"><CODE>OS_CONSOLE_SIZE_4MB</CODE></TD>
143<TD>4 MB</TD>
144    </TR>
145    <TR>
146<TD><CODE>OS_CONSOLE_SIZE_8MB</CODE></TD>
147<TD>8 MB</TD>
148    </TR>
149    <TR>
150<TD><CODE>OS_CONSOLE_SIZE_16MB</CODE></TD>
151<TD>16 MB</TD>
152    </TR>
153    <TR>
154<TD><CODE>OS_CONSOLE_SIZE_32MB</CODE></TD>
155<TD>32 MB</TD>
156    </TR>
157  </TBODY>
158</TABLE>
159<BR> If a NITRO-only ROM is run on TWL hardware, the memory size is 4 MB, regardless of the build type.</BLOCKQUOTE>
160<H3><B><BR>Actual Values Due to the Environment or Build</B></H3>
161<P>The table below indicates the values that can be obtained with the <CODE>OS_GetConsoleType</CODE> and <A href="OS_GetRunningConsoleType.html"><CODE>OS_GetRunningConsoleType</CODE></A> functions. The logical sum (bitwise OR) of the items in the table is the value obtained. <CODE>OS_CONSOLE_DEV_xxx</CODE> is the value of the device that actually loaded the ROM data.<BR> <BR>
162</P>
163<TABLE border="1">
164  <TBODY>
165    <TR>
166<TH colspan="5" style="background-color:#304040;"><FONT color="#ffffff">For NITRO Mode</FONT></TH>
167    </TR>
168    <TR>
169<TH>Operating Environment</TH>
170<TH>Build</TH>
171<TH>Value of the <CODE>OS_GetConsoleType</CODE> Function</TH>
172<TH>Value of the <CODE>OS_GetRunningConsoleType</CODE> Function</TH>
173<TH>Comments</TH>
174    </TR>
175    <TR>
176<TD rowspan="2">NTR system</TD>
177<TD>DEBUG<BR>RELEASE</TD>
178<TD><B><FONT color="#990099">OS_CONSOLE_NITRO</FONT></B><BR> OS_CONSOLE_DEV_xxx<BR> <B><FONT color="#339900">OS_CONSOLE_SIZE_4MB</FONT></B></TD>
179<TD><B><FONT color="#990099">OS_CONSOLE_NITRO</FONT></B><BR> OS_CONSOLE_DEV_xxx<BR> <B><FONT color="#339900">OS_CONSOLE_SIZE_4MB</FONT></B></TD>
180<TD rowspan="2">All 4 are<BR>the same.</TD>
181    </TR>
182    <TR>
183<TD>FINALROM</TD>
184<TD><B><FONT color="#990099">OS_CONSOLE_NITRO</FONT></B><BR> OS_CONSOLE_DEV_xxx<BR> <B><FONT color="#339900">OS_CONSOLE_SIZE_4MB</FONT></B></TD>
185<TD><B><FONT color="#990099">OS_CONSOLE_NITRO</FONT></B><BR> OS_CONSOLE_DEV_xxx<BR> <B><FONT color="#339900">OS_CONSOLE_SIZE_4MB</FONT></B></TD>
186    </TR>
187    <TR>
188<TD rowspan="2">TWL system</TD>
189<TD>DEBUG<BR>RELEASE</TD>
190<TD><B><FONT color="#990099">OS_CONSOLE_TWL<BR> OS_CONSOLE_TWLTYPE_RETAIL</FONT></B><BR> OS_CONSOLE_DEV_xxx<BR> <B><FONT color="#339900">OS_CONSOLE_SIZE_4MB</FONT></B></TD>
191<TD><B><FONT color="#990099">OS_CONSOLE_TWL<BR> OS_CONSOLE_TWLTYPE_RETAIL</FONT></B><BR> OS_CONSOLE_DEV_xxx<BR> <B><FONT color="#339900">OS_CONSOLE_SIZE_4MB</FONT></B></TD>
192<TD rowspan="2">The only difference is <BR>the <CODE>OS_GetConsoleType</CODE> function<BR> for FINALROM builds.<BR>The amount of built-in memory is <BR>4 MB, regardless of the build.</TD>
193    </TR>
194    <TR>
195<TD>FINALROM</TD>
196<TD style="background-color:#e0e0f0;"><B><FONT color="#990099"><FONT color="#990099">OS_CONSOLE_NITRO</FONT><BR> OS_CONSOLE_DEV_xxx<BR> <FONT color="#339900">OS_CONSOLE_SIZE_4MB</FONT></FONT></B></TD>
197<TD><B><FONT color="#990099">OS_CONSOLE_TWL<BR> OS_CONSOLE_TWLTYPE_RETAIL</FONT></B><BR> OS_CONSOLE_DEV_xxx<BR> <B><FONT color="#339900">OS_CONSOLE_SIZE_4MB</FONT></B></TD>
198    </TR>
199    <TR>
200<TD rowspan="2">IS-NITRO-DEBUGGER<BR> (debugger software<BR> even if not connected)</TD>
201<TD>DEBUG<BR>RELEASE</TD>
202<TD><FONT color="#990099"><B>OS_CONSOLE_ISDEBUGGER</B></FONT><BR> OS_CONSOLE_DEV_xxx<BR> <FONT color="#339900"><B>OS_CONSOLE_SIZE_8MB</B></FONT></TD>
203<TD><FONT color="#990099"><B>OS_CONSOLE_ISDEBUGGER</B></FONT><BR> OS_CONSOLE_DEV_xxx<BR> <FONT color="#339900"><B>OS_CONSOLE_SIZE_8MB</B></FONT></TD>
204<TD rowspan="2">The only difference is <BR>the <CODE>OS_GetConsoleType</CODE> function<BR>for FINALROM builds.<BR></TD>
205    </TR>
206    <TR>
207<TD>FINALROM</TD>
208<TD style="background-color:#e0e0f0;"><FONT color="#990099"><B>OS_CONSOLE_NITRO</B></FONT><BR> OS_CONSOLE_DEV_xxx<BR> <B><FONT color="#339900">OS_CONSOLE_SIZE_4MB</FONT></B></TD>
209<TD><FONT color="#990099"><B>OS_CONSOLE_ISDEBUGGER</B></FONT><BR> OS_CONSOLE_DEV_xxx<BR> <FONT color="#339900"><B>OS_CONSOLE_SIZE_8MB</B></FONT></TD>
210    </TR>
211    <TR>
212<TD rowspan="2">ENSATA EMULATOR</TD>
213<TD>DEBUG<BR>RELEASE</TD>
214<TD><FONT color="#990099"><B>OS_CONSOLE_ISDEBUGGER</B></FONT><BR> OS_CONSOLE_DEV_xxx<BR> <FONT color="#339900"><B>OS_CONSOLE_SIZE_8MB</B></FONT></TD>
215<TD><FONT color="#990099"><B>OS_CONSOLE_ISDEBUGGER</B></FONT><BR> OS_CONSOLE_DEV_xxx<BR> <FONT color="#339900"><B>OS_CONSOLE_SIZE_8MB</B></FONT></TD>
216<TD rowspan="2">The only difference is <BR>the <CODE>OS_GetConsoleType</CODE> function<BR>for FINALROM builds.<BR></TD>
217    </TR>
218    <TR>
219<TD>FINALROM</TD>
220<TD style="background-color:#e0e0f0;"><FONT color="#990099"><B>OS_CONSOLE_NITRO</B></FONT><BR> OS_CONSOLE_DEV_xxx<BR> <B><FONT color="#339900">OS_CONSOLE_SIZE_4MB</FONT></B></TD>
221<TD><FONT color="#990099"><B>OS_CONSOLE_ISDEBUGGER</B></FONT><BR> OS_CONSOLE_DEV_xxx<BR> <FONT color="#339900"><B>OS_CONSOLE_SIZE_8MB</B></FONT></TD>
222    </TR>
223    <TR>
224<TD rowspan="2">IS-TWL-DEBUGGER<BR>(For general-purpose development: ARM9)</TD>
225<TD>DEBUG<BR>RELEASE</TD>
226<TD><FONT color="#990099"><B>OS_CONSOLE_TWLDEBUGGER<BR> OS_CONSOLE_BOARD_A9</B></FONT><BR> OS_CONSOLE_DEV_xxx<BR> <B><FONT color="#339900">OS_CONSOLE_SIZE_32MB</FONT></B></TD>
227<TD><FONT color="#990099"><B>OS_CONSOLE_TWLDEBUGGER<BR> OS_CONSOLE_BOARD_A9</B></FONT><BR> OS_CONSOLE_DEV_xxx<BR> <B><FONT color="#339900">OS_CONSOLE_SIZE_32MB</FONT></B></TD>
228<TD rowspan="2">The only difference is <BR>the <CODE>OS_GetConsoleType</CODE> function<BR>for FINALROM builds.<BR></TD>
229    </TR>
230    <TR>
231<TD>FINALROM</TD>
232<TD style="background-color:#e0e0f0;"><B><FONT color="#990099">OS_CONSOLE_NITRO<BR> OS_CONSOLE_DEV_xxx<BR> <FONT color="#339900">OS_CONSOLE_SIZE_4MB</FONT></FONT></B></TD>
233<TD><FONT color="#990099"><B>OS_CONSOLE_TWLDEBUGGER<BR> OS_CONSOLE_BOARD_A9</B></FONT><BR> OS_CONSOLE_DEV_xxx<BR> <B><FONT color="#339900">OS_CONSOLE_SIZE_32MB</FONT></B></TD>
234    </TR>
235    <TR>
236<TD rowspan="2">IS-TWL-DEBUGGER<BR>(For component development:<BR>ARM9 + ARM7)</TD>
237<TD>DEBUG<BR>RELEASE</TD>
238<TD><FONT color="#990099"><B>OS_CONSOLE_TWLDEBUGGER<BR> OS_CONSOLE_BOARD_A9_A7</B></FONT><BR> OS_CONSOLE_DEV_xxx<BR> <B><FONT color="#339900">OS_CONSOLE_SIZE_32MB</FONT></B></TD>
239<TD><FONT color="#990099"><B>OS_CONSOLE_TWLDEBUGGER<BR> OS_CONSOLE_BOARD_A9_A7</B></FONT><BR> OS_CONSOLE_DEV_xxx<BR> <B><FONT color="#339900">OS_CONSOLE_SIZE_32MB</FONT></B></TD>
240<TD rowspan="2">The only difference is <BR>the <CODE>OS_GetConsoleType</CODE> function<BR>for FINALROM builds.<BR></TD>
241    </TR>
242    <TR>
243<TD>FINALROM</TD>
244<TD style="background-color:#e0e0f0;"><B><FONT color="#990099">OS_CONSOLE_NITRO<BR> OS_CONSOLE_DEV_xxx<BR> <FONT color="#339900">OS_CONSOLE_SIZE_4MB</FONT></FONT></B></TD>
245<TD><FONT color="#990099"><B>OS_CONSOLE_TWLDEBUGGER<BR> OS_CONSOLE_BOARD_A9_A7</B></FONT><BR> OS_CONSOLE_DEV_xxx<BR> <B><FONT color="#339900">OS_CONSOLE_SIZE_32MB</FONT></B></TD>
246    </TR>
247    <TR>
248<TD rowspan="2">IS-TWL-DEBUGGER<BR>(For general-purpose development: ARM9)<BR> When not connected to debugger software</TD>
249<TD>DEBUG<BR>RELEASE</TD>
250<TD><FONT color="#990099"><B>OS_CONSOLE_TWL<BR> OS_CONSOLE_TWLTYPE_DEV</B></FONT><BR> OS_CONSOLE_DEV_xxx<BR> <B><FONT color="#339900">OS_CONSOLE_SIZE_4MB</FONT></B></TD>
251<TD><FONT color="#990099"><B>OS_CONSOLE_TWL<BR> OS_CONSOLE_TWLTYPE_DEV</B></FONT><BR> OS_CONSOLE_DEV_xxx<BR> <B><FONT color="#339900">OS_CONSOLE_SIZE_4MB</FONT></B></TD>
252<TD rowspan="2">The only difference is <BR>the <CODE>OS_GetConsoleType</CODE> function<BR> for FINALROM builds.<BR><BR> The amount of built-in memory is <BR>4 MB, regardless of the build.</TD>
253    </TR>
254    <TR>
255<TD>FINALROM</TD>
256<TD style="background-color:#e0e0f0;"><B><FONT color="#990099">OS_CONSOLE_NITRO<BR> OS_CONSOLE_DEV_xxx<BR> <FONT color="#339900">OS_CONSOLE_SIZE_4MB</FONT></FONT></B></TD>
257<TD><FONT color="#990099"><B>OS_CONSOLE_TWL<BR> OS_CONSOLE_TWLTYPE_DEV</B></FONT><BR> OS_CONSOLE_DEV_xxx<BR> <B><FONT color="#339900">OS_CONSOLE_SIZE_4MB</FONT></B></TD>
258    </TR>
259    <TR>
260<TD rowspan="2">IS-TWL-DEBUGGER<BR>(For component development:<BR>ARM9 + ARM7)<BR> When not connected to debugger software</TD>
261<TD>DEBUG<BR>RELEASE</TD>
262<TD><FONT color="#990099"><B>OS_CONSOLE_TWL<BR> OS_CONSOLE_TWLTYPE_DEV</B></FONT><BR> OS_CONSOLE_DEV_xxx<BR> <B><FONT color="#339900">OS_CONSOLE_SIZE_4MB</FONT></B></TD>
263<TD><FONT color="#990099"><B>OS_CONSOLE_TWL<BR> OS_CONSOLE_TWLTYPE_DEV</B></FONT><BR> OS_CONSOLE_DEV_xxx<BR> <B><FONT color="#339900">OS_CONSOLE_SIZE_4MB</FONT></B></TD>
264<TD rowspan="2">The only difference is <BR>the <CODE>OS_GetConsoleType</CODE> function<BR> for FINALROM builds.<BR><BR> The amount of built-in memory is <BR>4 MB, regardless of the build.</TD>
265    </TR>
266    <TR>
267<TD>FINALROM</TD>
268<TD style="background-color:#e0e0f0;"><B><FONT color="#990099">OS_CONSOLE_NITRO<BR> OS_CONSOLE_DEV_xxx<BR> <FONT color="#339900">OS_CONSOLE_SIZE_4MB</FONT></FONT></B></TD>
269<TD><FONT color="#990099"><B>OS_CONSOLE_TWL<BR> OS_CONSOLE_TWLTYPE_DEV7</B></FONT><BR> OS_CONSOLE_DEV_xxx<BR> <B><FONT color="#339900">OS_CONSOLE_SIZE_4MB</FONT></B></TD>
270    </TR>
271    <TR>
272<TH colspan="5" style="background-color:#304040;"><FONT color="#ffffff">For TWL Mode</FONT></TH>
273    </TR>
274    <TR>
275<TH>Operating Environment</TH>
276<TH>Build</TH>
277<TH>Value of the <CODE>OS_GetConsoleType</CODE> Function</TH>
278<TH>Value of the <CODE>OS_GetRunningConsoleType</CODE> Function</TH>
279<TH>Comments</TH>
280    </TR>
281    <TR>
282<TD rowspan="2">TWL system</TD>
283<TD>DEBUG<BR>RELEASE</TD>
284<TD><B><FONT color="#990099">OS_CONSOLE_TWL<BR> OS_CONSOLE_TWLTYPE_RETAIL</FONT></B><BR> OS_CONSOLE_DEV_xxx<BR> <B><FONT color="#339900">OS_CONSOLE_SIZE_16MB</FONT></B></TD>
285<TD><B><FONT color="#990099">OS_CONSOLE_TWL<BR> OS_CONSOLE_TWLTYPE_RETAIL</FONT></B><BR> OS_CONSOLE_DEV_xxx<BR> <B><FONT color="#339900">OS_CONSOLE_SIZE_16MB</FONT></B></TD>
286<TD rowspan="2">All 4 are<BR>the same.</TD>
287    </TR>
288    <TR>
289<TD>FINALROM</TD>
290<TD><B><FONT color="#990099">OS_CONSOLE_TWL<BR> OS_CONSOLE_TWLTYPE_RETAIL</FONT></B><BR> OS_CONSOLE_DEV_xxx<BR> <B><FONT color="#339900">OS_CONSOLE_SIZE_16MB</FONT></B></TD>
291<TD><B><FONT color="#990099">OS_CONSOLE_TWL<BR> OS_CONSOLE_TWLTYPE_RETAIL</FONT></B><BR> OS_CONSOLE_DEV_xxx<BR> <B><FONT color="#339900">OS_CONSOLE_SIZE_16MB</FONT></B></TD>
292    </TR>
293    <TR>
294<TD rowspan="2">IS-TWL-DEBUGGER<BR>(For general-purpose development: ARM9)</TD>
295<TD>DEBUG<BR>RELEASE</TD>
296<TD><FONT color="#990099"><B>OS_CONSOLE_TWLDEBUGGER<BR> OS_CONSOLE_BOARD_A9</B></FONT><BR> OS_CONSOLE_DEV_xxx<BR> <B><FONT color="#339900">OS_CONSOLE_SIZE_32MB</FONT></B></TD>
297<TD><FONT color="#990099"><B>OS_CONSOLE_TWLDEBUGGER<BR> OS_CONSOLE_BOARD_A9</B></FONT><BR> OS_CONSOLE_DEV_xxx<BR> <B><FONT color="#339900">OS_CONSOLE_SIZE_32MB</FONT></B></TD>
298<TD rowspan="2">The only difference is <BR>the <CODE>OS_GetConsoleType</CODE> function<BR>for FINALROM builds.<BR></TD>
299    </TR>
300    <TR>
301<TD>FINALROM</TD>
302<TD style="background-color:#e0e0f0;"><B><FONT color="#990099">OS_CONSOLE_TWL<BR> OS_CONSOLE_TWLTYPE_RETAIL</FONT></B><BR> OS_CONSOLE_DEV_xxx<BR> <B><FONT color="#339900">OS_CONSOLE_SIZE_16MB</FONT></B></TD>
303<TD><FONT color="#990099"><B>OS_CONSOLE_TWLDEBUGGER<BR> OS_CONSOLE_BOARD_A9</B></FONT><BR> OS_CONSOLE_DEV_xxx<BR> <B><FONT color="#339900">OS_CONSOLE_SIZE_32MB</FONT></B></TD>
304    </TR>
305    <TR>
306<TD rowspan="2">IS-TWL-DEBUGGER<BR>(For component development:<BR>ARM9 + ARM7)</TD>
307<TD>DEBUG<BR>RELEASE</TD>
308<TD><FONT color="#990099"><B>OS_CONSOLE_TWLDEBUGGER<BR> OS_CONSOLE_BOARD_A9_A7</B></FONT><BR> OS_CONSOLE_DEV_xxx<BR> <B><FONT color="#339900">OS_CONSOLE_SIZE_32MB</FONT></B></TD>
309<TD><FONT color="#990099"><B>OS_CONSOLE_TWLDEBUGGER<BR> OS_CONSOLE_BOARD_A9_A7</B></FONT><BR> OS_CONSOLE_DEV_xxx<BR> <B><FONT color="#339900">OS_CONSOLE_SIZE_32MB</FONT></B></TD>
310<TD rowspan="2">The only difference is <BR>the <CODE>OS_GetConsoleType</CODE> function<BR>for FINALROM builds.<BR></TD>
311    </TR>
312    <TR>
313<TD>FINALROM</TD>
314<TD style="background-color:#e0e0f0;"><B><FONT color="#990099">OS_CONSOLE_TWL<BR> OS_CONSOLE_TWLTYPE_RETAIL</FONT></B><BR> OS_CONSOLE_DEV_xxx<BR> <B><FONT color="#339900">OS_CONSOLE_SIZE_16MB</FONT></B></TD>
315<TD><FONT color="#990099"><B>OS_CONSOLE_TWLDEBUGGER<BR> OS_CONSOLE_BOARD_A9_A7</B></FONT><BR> OS_CONSOLE_DEV_xxx<BR> <B><FONT color="#339900">OS_CONSOLE_SIZE_32MB</FONT></B></TD>
316    </TR>
317    <TR>
318<TD rowspan="2">IS-TWL-DEBUGGER<BR>(For general-purpose development: ARM9)<BR> When not connected to debugger software</TD>
319<TD>DEBUG<BR>RELEASE</TD>
320<TD><FONT color="#990099"><B>OS_CONSOLE_TWL<BR> OS_CONSOLE_TWLTYPE_DEV</B></FONT><BR> OS_CONSOLE_DEV_xxx<BR> <B><FONT color="#339900">OS_CONSOLE_SIZE_32MB</FONT></B></TD>
321<TD><FONT color="#990099"><B>OS_CONSOLE_TWL<BR> OS_CONSOLE_TWLTYPE_DEV</B></FONT><BR> OS_CONSOLE_DEV_xxx<BR> <B><FONT color="#339900">OS_CONSOLE_SIZE_32MB</FONT></B></TD>
322<TD rowspan="2">The only difference is <BR>the <CODE>OS_GetConsoleType</CODE> function<BR>for FINALROM builds.<BR></TD>
323    </TR>
324    <TR>
325<TD>FINALROM</TD>
326<TD style="background-color:#e0e0f0;"><B><FONT color="#990099">OS_CONSOLE_TWL<BR> OS_CONSOLE_TWLTYPE_RETAIL</FONT></B><BR> OS_CONSOLE_DEV_xxx<BR> <B><FONT color="#339900">OS_CONSOLE_SIZE_16MB</FONT></B></TD>
327<TD><FONT color="#990099"><B>OS_CONSOLE_TWL<BR> OS_CONSOLE_TWLTYPE_DEV</B></FONT><BR> OS_CONSOLE_DEV_xxx<BR> <B><FONT color="#339900">OS_CONSOLE_SIZE_32MB</FONT></B></TD>
328    </TR>
329    <TR>
330<TD rowspan="2">IS-TWL-DEBUGGER<BR>(For component development:<BR>ARM9 + ARM7)<BR> When not connected to debugger software</TD>
331<TD>DEBUG<BR>RELEASE</TD>
332<TD><FONT color="#990099"><B>OS_CONSOLE_TWL<BR> OS_CONSOLE_TWLTYPE_DEV</B></FONT><BR> OS_CONSOLE_DEV_xxx<BR> <B><FONT color="#339900">OS_CONSOLE_SIZE_32MB</FONT></B></TD>
333<TD><FONT color="#990099"><B>OS_CONSOLE_TWL<BR> OS_CONSOLE_TWLTYPE_DEV</B></FONT><BR> OS_CONSOLE_DEV_xxx<BR> <B><FONT color="#339900">OS_CONSOLE_SIZE_32MB</FONT></B></TD>
334<TD rowspan="2">The only difference is <BR>the <CODE>OS_GetConsoleType</CODE> function<BR>for FINALROM builds.<BR></TD>
335    </TR>
336    <TR>
337<TD>FINALROM</TD>
338<TD style="background-color:#e0e0f0;"><B><FONT color="#990099">OS_CONSOLE_TWL<BR> OS_CONSOLE_TWLTYPE_RETAIL</FONT></B><BR> OS_CONSOLE_DEV_xxx<BR> <B><FONT color="#339900">OS_CONSOLE_SIZE_16MB</FONT></B></TD>
339<TD><FONT color="#990099"><B>OS_CONSOLE_TWL<BR> OS_CONSOLE_TWLTYPE_DEV</B></FONT><BR> OS_CONSOLE_DEV_xxx<BR> <B><FONT color="#339900">OS_CONSOLE_SIZE_32MB</FONT></B></TD>
340    </TR>
341  </TBODY>
342</TABLE>
343<P><BR>
344</P>
345<P><BR><B>Identifying the Operating Environment in NITRO Mode</B></P>
346<P>When running in NITRO mode, it is impossible to determine whether hardware is NTR or TWL using just the <CODE>OS_GetConsoleType</CODE> function. Although the distinction can be made by checking the value of the <CODE><A href="OS_GetRunningConsoleType.html">OS_GetRunningConsoleType</A></CODE> function, Nintendo prefers that developers only use the <CODE><A href="OS_GetRunningConsoleType.html">OS_GetRunningConsoleType</A></CODE> function for debugging purposes. Although there is usually no need to know which hardware system is running, the <CODE>OSi_IsNitroModeOnTwl</CODE> function has been prepared in case you need to identify the system. If this function returns <CODE>TRUE</CODE>, it will indicate that a NITRO-mode ROM is running on TWL.</P>
347<P>The <CODE>OSi_IsNitroModeOnTwl</CODE> function, which includes <I>TWL</I> in its name, was originally handled as private when TWL development first began. This was based on the reasoning that the <CODE>OSi_IsNitroModeOnTwl</CODE> function should be used for limited purposes, and that NITRO developers were not familiar with TWL. This function is still private.</P>
348<H2>See Also</H2>
349<P><A href="OS_IsRunOnDebugger.html"><CODE>OS_IsRunOnDebugger</CODE></A><BR> <A href="OS_IsRunOnEmulator.html"><CODE>OS_IsRunOnEmulator</CODE></A><BR> <A href="OS_GetRunningConsoleType.html"><CODE>OS_GetRunningConsoleType</CODE></A></P>
350<H2>Revision History</H2>
351<P>2009/10/30 Added information about operation when a debugger is not connected. Revised operating environment identification in NITRO mode.<BR>2008/04/15 Split up tables according to the mode.<BR>2008/03/27 Added actual values dependent on the environment and build.<BR>2007/11/16 Added descriptions.<BR>2007/11/05 Migrated to the <CODE>OS_GetRunningConsoleType</CODE> function.</P>
352<hr><p>CONFIDENTIAL</p></body>
353</HTML>