The SGADE Documentation

the SGADE The Socrates Gameboy Advance Development Engine

The SGADE is a development library for the Nintendo Gameboy Advance. It's free for all uses and is distributed without guarantees. For more information visit the SGADE page.


Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages  

SoMultiPlayer.h

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00014 // ----------------------------------------------------------------------------
00015 
00016 #ifndef SO_MULTIPLAYER_H
00017 #define SO_MULTIPLAYER_H
00018 
00019 #ifdef __cplusplus
00020     extern "C" {
00021 #endif
00022 
00023 
00024 // ---------------------------------------------------------------------------- //! @{
00044 // ----------------------------------------------------------------------------
00045 
00046 // ----------------------------------------------------------------------------
00047 // Includes
00048 // ----------------------------------------------------------------------------
00049 #include "SoSystem.h"
00050 
00051 // ----------------------------------------------------------------------------
00052 // Defines
00053 // ----------------------------------------------------------------------------
00054 
00065 #define SO_MULTI_PLAYER_PACKET_TRANSFER_SIZE    4
00066 
00067 
00079 #define SO_MULTIPLAYER_FRAME_RATE               60
00080 
00081 // Different baud rates
00082 #define SO_MULTI_PLAYER_9600_BPS                0   
00083 #define SO_MULTI_PLAYER_38400_BPS               1   
00084 #define SO_MULTI_PLAYER_57600_BPS               2   
00085 #define SO_MULTI_PLAYER_115200_BPS              3   
00086 
00087 // ----------------------------------------------------------------------------
00088 // Typedefs
00089 // ----------------------------------------------------------------------------
00090 
00098 typedef bool (*SoMultiPlayerFailureCallback)( void );
00099 
00100 // ----------------------------------------------------------------------------
00101 // Functions;
00102 // ----------------------------------------------------------------------------
00103 
00104 void SoMultiPlayerInitialize( void );
00105 
00106 bool SoMultiPlayerStart( u32 a_BaudRate, u32 a_NumPlayers );
00107 void SoMultiPlayerStop(  void );
00108 
00109 void SoMultiPlayerUpdate( u16 a_OutGoingPacket[ SO_MULTI_PLAYER_PACKET_TRANSFER_SIZE ], 
00110                           u16 a_IncomingPackets[ 4 ][ SO_MULTI_PLAYER_PACKET_TRANSFER_SIZE ] );
00111 
00112 void SoMultiPlayerSetFailureCallback( SoMultiPlayerFailureCallback a_FailureCallback );
00113 
00114 u32  SoMultiPlayerGetNumPlayers( void );
00115 u32  SoMultiPlayerGetID(            void );
00116 
00117 
00118 // ----------------------------------------------------------------------------
00119 // EOF;
00120 // ----------------------------------------------------------------------------
00121 
00123 
00124 #ifdef __cplusplus
00125 } // extern "C"
00126 #endif
00127 
00128 #endif

Copyright 2002 by the SGADE authors. See SoLicense.h or Visit the SGADE page for more information.