#ifdef _DEBUG
#define MEDNA_NES 1
#define MEDNA_PCE 2
#define MEDNA_LYNX 3
#define MEDNA_TYPE MEDNA_NES
#endif

#ifdef  __cplusplus
extern "C" {
#endif
unsigned int xbox_get_pitch();
char *xbox_savedir() ;
int xbox_check_events() ;
void xbox_feed_stream( unsigned char *data, long maxcopy ) ;
unsigned int xbox_canwrite( ) ;
void xbox_set_RAM_location() ;
unsigned char * xbox_getvidbuffer();
extern int throttle ;
extern int sounddanger ;
#ifdef  __cplusplus
}
#endif



#include <xtl.h>
#include <sdl.h>

#define PSS "\\"

#define mkdir(dirname) CreateDirectory(##dirname, NULL)


void MDFND_NetworkConnect();

#define strcasecmp stricmp

extern char *XBOX_HOME ;
extern int MDFNDnetplay ;


bool MDFNI_NetplayPrestart(unsigned char extra[32]);
int MDFNI_NetplayStart(int nlocal);

/* Call when network play needs to stop. */
void MDFNI_NetplayStop(void);

/* Note:  YOU MUST NOT CALL ANY MDFNI_* FUNCTIONS WHILE IN MDFND_SendData() or
   MDFND_RecvData().
*/

/* Return 0 on failure, 1 on success. */
int MDFND_SendData(const void *data, unsigned int len);
int MDFND_RecvData(void *data, unsigned int len);

/* Display text received over the network. */
void MDFND_NetplayText(const unsigned char *text);

/* Encode and send text over the network. */
void MDFNI_NetplayText(const unsigned char *text);

/* Called when a fatal error occurred and network play can't continue.  This function
   should call MDFNI_NetplayStop() after it has deinitialized the network on the driver
   side.
*/
void MDFND_NetworkClose(void);

int NetplayEventHook(const SDL_Event *event);
void Netplay_ToggleTextView(void);
void NetplayText_InMainThread(unsigned char *text);
int Netplay_GetTextView(void);
