/*---------------------------------------------------------------------------*
  Project:  NitroSDK - WM - libraries
  File:     wm_private.h

  Copyright 2003,2004 Nintendo.  All rights reserved.

  These coded instructions, statements, and computer programs contain
  proprietary information of Nintendo of America Inc. and/or Nintendo
  Company Ltd., and are protected by Federal copyright law.  They may
  not be disclosed to third parties or copied or duplicated in any form,
  in whole or in part, without the prior written consent of Nintendo.

  $Log: wm_private.h,v $
  Revision 1.18  2004/08/18 00:23:40  seiki_masashi
  Moved part of constant to wm.h

  Revision 1.17  2004/08/17 12:49:11  seiki_masashi
  Added constant

  Revision 1.16  2004/08/12 14:23:26  seiki_masashi
  Added WM_DEBUG_INDICATES

  Revision 1.15  2004/08/11 04:24:24  seiki_masashi
 Debug flag added

  Revision 1.14  2004/08/07 05:16:44  seiki_masashi
  WM_DEBUG set to OFF

  Revision 1.13  2004/08/07 00:20:29  seiki_masashi
  WM_HEADER_SEQ_NUM_MASK added

  Revision 1.12  2004/08/06 05:11:39  seiki_masashi
  WM_DEBUG switch added

  Revision 1.11  2004/08/05 10:02:44  seiki_masashi
  KS bit position in wmHeader changed from 0x0002 to 0x4000 

  Revision 1.10  2004/08/04 01:33:34  seiki_masashi
  VSYNC flag position changed
  Preparation for introduction of port 

  Revision 1.9  2004/07/28 02:44:11  terui
  Unnecessary definitions deleted. 
  Definitions for WM internal states moved to wm.h

  Revision 1.8  2004/07/27 07:30:30  yasu
  Add #pragma  warn_padding off

  Revision 1.7  2004/07/11 03:12:23  ooe
  Beacon-related CMDSTATE added

  Revision 1.6  2004/07/10 11:49:24  terui
  Changes relating to change of Marionea install location 

  Revision 1.5  2004/07/08 09:50:22  terui
  Changes reflecting start of WM7 overhaul

  Revision 1.8  2004/07/06 08:11:47  Ooe
  Support for WL-1.56.00

  Revision 1.7  2004/07/06 01:54:47  Ooe
  WM header bit definition added

  Revision 1.6  2004/07/03 07:30:21  Ooe
  CMDSTATE added

  Revision 1.5  2004/06/24 10:04:23  Ooe
  WM_SetGameInfo() added
  
  Revision 1.4  2004/06/21 06:40:20  Ooe
  (none)

  Revision 1.3  2004/06/19 05:56:20  Miya
  modified header file reference

  Revision 1.4  2004/06/19 04:05:16  miya
  ver. up Marionea-1.48.00

  Revision 1.3  2004/06/14 04:18:44  terui
  Undefine OS_Printf on FINALROM build mode.

  Revision 1.2  2004/06/02 02:29:51  miya
  New version

  Revision 1.1  2004/05/26 08:54:40  terui
  Additions reflecting embed of wireless functionality

  $NoKeywords: $
 *---------------------------------------------------------------------------*/
#ifndef LIBRARIES_WM_PRIVATE_H_
#define LIBRARIES_WM_PRIVATE_H_

#ifdef  __cplusplus
extern "C" {
#endif

/*===========================================================================*/


#include <nitro.h>

#ifdef SDK_ARM7
#include <nitro_wl/ARM7/WlLib.h>
#endif

#define WM_DEBUG                0 // WM debug flag (mainly ARM7)
#define WM_DEBUG_DATASHARING    0 // DataSharing-related debug message flag (ARM9)
#define WM_DEBUG_INDICATES      0 // Display flag for each indicate(ARM7)
#define WM_DEBUG_PORT_SENDRECV  0 // Port send/receive packet display flag (ARM7)
#define DEBUG_WM_USE_PRINTF 1   // When using OS_Printf

#ifndef DEBUG_WM_USE_PRINTF
//----------------------------------------------
// Convert OS_Printf to a function that does nothing 
void Dummy_Printf(const char *fmt, ... );
#ifndef SDK_FINALROM
#define OS_Printf Dummy_Printf
#endif
#endif /* DEBUG_WM_USE_PRINTF */

// Macros
#define ROUND(n, a)             (((u32) (n) + (a) - 1) & ~((a) - 1))
#define SwapEndianWord(_x_)     (u16) ( (_x_>>8) | ((_x_&0xFF)<<8) )

#define GetPortNum(n)           ((u16)(((n)&WM_HEADER_PORT_MASK)>>WM_HEADER_PORT_SHIFT))


/*===========================================================================*/

#ifdef  __cplusplus
}       /* extern "C" */
#endif

#endif  /* LIBRARIES_WM_PRIVATE_H_ */

/*---------------------------------------------------------------------------*
  End of file
 *---------------------------------------------------------------------------*/
