/*
	Nindows2 Library
	
	COPYRIGHT (C) SEGA ENTERPRISES,LTD.

*/
#ifndef _NINDOWS2_H_
#define _NINDOWS2_H_

#ifdef __cplusplus
extern "C" {
#endif
//-----------------------------------------------------------------------------

#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <ctype.h>

#define NWD_FONT_AUTO			(0xffffffff)
#define NWD_FONT_SMALL			(0x00000000)
#define NWD_FONT_NORMAL			(0x00000001)
#define NWD_FONT_LARGE			(0x00000002)

#define NWD_USE_KEYBOARD		(0x00000001)
#define NWD_USE_MOUSE			(0x00000002)
#define NWD_USE_SERIAL			(0x00000004)
#define NWD_USE_LIBCROSS		(0x00000008)
#define NWD_USE_EXCEPTION		(0x00000010)

#define NWD_WINDOW_INFORMATION	(0x00000100)
#define NWD_WINDOW_TEXTURE		(0x00000200)
#define NWD_WINDOW_PERFORMANCE	(0x00000400)
#define NWD_WINDOW_CONSOLE		(0x00000800)
#define NWD_WINDOW_PERIPHERAL	(0x00001000)
#define NWD_WINDOW_FIBER		(0x00002000)

#define NWD_FPUEXP_VIOLATION	(0x00000010)
#define NWD_FPUEXP_DIV0			(0x00000008)
#define NWD_FPUEXP_OVER			(0x00000004)
#define NWD_FPUEXP_UNDER		(0x00000002)
#define NWD_FPUEXP_INVALID		(0x00000001)

#define NWD_EASY_DRAW			(0x80000000)

typedef int (*PNWEXEC)( int argc, char *argv[] );

typedef struct {
	int		nSize;
	int		nFlags;
	void	*pWork;
	int		nWorkSize;
	int		nPadPort;
	int		nFontSize;
} NWINFORMATION;

typedef struct {
	PNWEXEC		pFunc;
	char		xComdName[16];
	char		xHelp[64];
} NWREGIST, *PNWREGIST;

//-----------------------------------------------------------------------------

int nwGetWorkSize( void );
void nwInitialize( const NWINFORMATION *pInfo );
void nwFinalize( void );
int nwMainExecute( void );
int nwCalcExecute( void );
int nwDrawExecute( void );
void nwDbPrintf( const char *pFmt, ...);
void nwDbPrint( const char *pStr );
void nwRegisterCommand( const PNWREGIST pReg );
void nwUnregisterCommand( const PNWREGIST pReg );
void nwExecuteCommand( const char *pStr );
void nwUserInfo( int nID );
int nwSetFpuException( int nEnableBits, int nDisableBits );

//-----------------------------------------------------------------------------
#ifdef __cplusplus
}
#endif
#endif
