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=windows-1252"> 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_GetRunningConsoleType</TITLE> 8<LINK rel="stylesheet" href="../../css/nitro.css" type="text/css"> 9</HEAD> 10<BODY> 11<H1 align="left">OS_GetRunningConsoleType <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 <nitro/os.h></CODE><BR> <BR> <CODE>u32 OS_GetRunningConsoleType( 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 which indicates the environment in which the program is executing.</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_GetRunningConsoleType</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></CODE> function to find out the operating mode. For example, games for NTR can be played on NTR as well as 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<P>The first time it is called, the <CODE>OS_GetRunningConsoleType</CODE> function will survey the devices, memory, and other information to determine its return value, but in subsequent calls, it will just return the same value it returned earlier. As a result, there is hardly any overhead in calling this function.</P> 25<H3>Similar Functions</H3> 26<P>There is a similar function called <A href="OS_GetConsoleType.html"><CODE>OS_GetConsoleType</CODE></A>. This will return a value with FINALROM builds that always indicates an <I>actual console</I>, as opposed to a debugger or emulator. In contrast, the <CODE>OS_GetRunningConsoleType</CODE> function will actually determine the hardware configuration and return the appropriate value, even for FINALROM builds.</P> 27<P>If either of these functions for getting the operating environment is being left in a FINALROM build, it would be safer to use the <A href="OS_GetConsoleType.html"><CODE>OS_GetConsoleType</CODE></A> 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 has become 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 on the retail product (such as "operating environment is the debugger") 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> 28<P><B>Values That Can Be Obtained <BR>Actual Values Due to the Environment or Build <BR>Identifying the Operating Environment in NITRO Mode</B></P> 29<P>For this information, see the explanations for the <A href="OS_GetConsoleType.html"><CODE>OS_GetConsoleType</CODE></A> function.</P> 30<H2>See Also</H2> 31<P><A href="OS_IsRunOnEmulator.html"><CODE>OS_IsRunOnEmulator</CODE></A><BR> <A href="OS_GetConsoleType.html"><CODE>OS_GetConsoleType</CODE></A></P> 32<H2>Revision History</H2> 33<P>2007/11/05 Migrated from the <CODE>OS_GetConsoleType</CODE> function.<BR> 2007/10/29 Added information about values under the TWL environment.<BR> 2004/10/12 Described that a constant is returned in the FINALROM version.<BR> 2004/08/17 Standardized the notation used for IS-NITRO-EMULATOR.<BR> 2004/06/08 Initial version.</P> 34<hr><p>CONFIDENTIAL</p></body> 35</HTML>