/* << MSC V5.1 >> *************************************************************
**
**	GRP.LIB  ﾍｯﾀﾞ  for FMRｼﾘｰｽﾞ & PC98
**
**	CREATE : 1990.09.19
**	FINISH : 1990.09.19
**
**	< NOTES >
**	TABS = 4
**
**	< HISTORY >
**	1990.09.19 : CREATE
**	1991.01.17 : FMR用とPC98用を同じｿｰｽにした。
**
**	All Rights Reserved, Copyright (C) Y.Hirata 1990-1991.
**
**	Programmed by Y.Hirata ( Nifty ID : NAB03321 )
**
******************************************************************************/

#include <graph.h>
#include "defs.h"

#ifdef DOT_24						/*  24ﾄﾞｯﾄ用	*/
	#define		VIEW_XS		0
	#define		VIEW_XE		1119
	#define		VIEW_YS		0
	#define		VIEW_YE		749
	#define		XDOTS		14
	#define		YDOTS		30
#else								/*  16ﾄﾞｯﾄ用	*/
	#define		VIEW_XS		0
	#define		VIEW_XE		639
	#define		VIEW_YS		0
	#define		VIEW_YE		399
	#define		XDOTS		8
	#define		YDOTS		16
#endif

enum Values_for_colors {
		C_BLACK,	C_BLUE,		C_GREEN,	C_SKYBLUE,
		C_RED,		C_PURPLE,	C_YELLOW,	C_WHITE,
		C_GRAY,		C_HBLUE,	C_HGREEN,	C_HSKYBLUE,
		C_HRED,		C_HPURPLE,	C_HYELLOW,	C_HWHITE
	} ;

/*-----  GRP_clearScreen用  ---------*/
#define		CLEARGRAPH	_GCLEARGRAPH	/*  ｸﾞﾗﾌｨｯｸだけをｸﾘｱする		*/
#define		CLEARTEXT	_GCLEARTEXT		/*  ﾃｷｽﾄだけをｸﾘｱする			*/
#define		CLEARSCREEN	_GCLEARSCREEN	/*  ｸﾞﾗﾌｨｯｸ & ﾃｷｽﾄ をｸﾘｱする	*/

/*-----  GRP_putBlock用  ------------*/
#define		GAND		_GAND
#define		GOR			_GOR
#define		GPRESET		_GPRESET
#define		GPSET		_GPSET
#define		GXOR		_GXOR

/**************************  ｸﾞﾗﾌｨｯｸ環境の初期設定  **************************/
void far GRP_init( void ) ;

/**************************  ｸﾞﾗﾌｨｯｸ環境の終了設定  **************************/
void far GRP_end( void ) ;

/*****************************  ｲﾒｰｼﾞｻｲｽﾞ取得  *******************************/
long far GRP_imagesize( short x1,short y1,short x2,short y2 ) ;

/*****************************  ｲﾒｰｼﾞﾃﾞｰﾀ取得  *******************************/
void far GRP_getBlock( short x1,short y1,short x2,short y2,char *image ) ;

/*****************************  ｲﾒｰｼﾞﾃﾞｰﾀ展開  *******************************/
void far GRP_putBlock( short x,short y,char *image,short action ) ;

/******************************  ﾊﾟﾚｯﾄ色設定  ********************************/
void far GRP_palette( short color, long pixel ) ;

/**************************  論理座標上の色取得  *****************************/
short far GRP_getpixel( short x, short y ) ;

/***************************  書き込みﾍﾟｰｼﾞの設定  ***************************/
void far GRP_writePage( short page ) ;

/*****************************  表示ﾍﾟｰｼﾞの設定  *****************************/
void far GRP_displayPage( short page ) ;

/*******************************  背景色設定  ********************************/
void far GRP_bkcolor( long pixel ) ;

/*******************************  背景色取得  ********************************/
long far GRP_getbkcolor( void ) ;

/*******************************  描画色設定  ********************************/
void far GRP_color( short colorno ) ;

/*******************************  描画色取得  ********************************/
short far GRP_getcolor( void ) ;

/*******************************  ﾌｨﾙﾏｽｸ設定  ********************************/
void far GRP_setfillmask( unsigned char *mask ) ;

/*******************************  線形状設定  ********************************/
void far GRP_linestyle( unsigned short style ) ;

/******************************  ｶﾚﾝﾄ位置設定  *******************************/
void far GRP_setposion( short x, short y ) ;

/***************************  論理座標原点の設定  ****************************/
void far GRP_setlogorg( short x, short y ) ;

/****************************  ｸﾘｯﾌﾟ領域の設定  *****************************/
void far GRP_viewport( short x1, short y1, short x2, short y2 ) ;

/*********************************  線描画  **********************************/
void far GRP_line( short x1, short y1, short x2, short y2 ) ;

/*********************************  点描画  **********************************/
void far GRP_pset( short x, short y ) ;

/********************************  矩形描画  *********************************/
void far GRP_rectangle( short x1, short y1, short x2, short y2, short control ) ;

/*********************************  弧描画  **********************************/
void far GRP_arc( short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4 ) ;

/*********************************  円描画  **********************************/
void far GRP_circle( short x, short y, short r, short control ) ;

/********************************  楕円描画  *********************************/
void far GRP_ellipse( short x, short y, short rx, short ry, short control ) ;

/********************************  扇形描画  *********************************/
void far GRP_pie( short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4, short control ) ;

/********************************  塗り潰し  *********************************/
void far GRP_paint( short x, short y, short color ) ;

/*****************************  ｸﾞﾗﾌｨｯｸ画面ｸﾘｱ  ******************************/
void far GRP_clearScreen( short sw ) ;

/****************************  ﾃｷｽﾄ表示位置取得  *****************************/
void far GRP_gettextposition( short *row, short *column ) ;

/****************************  ﾃｷｽﾄ表示位置設定  *****************************/
void far GRP_locate( short row, short column ) ;

/*****************************  ﾃｷｽﾄ表示色設定  ******************************/
void far GRP_textcolor( short color ) ;

/********************************  ﾃｷｽﾄ表示  *********************************/
void far GRP_outtext( char far *text ) ;

/********************************  ｶｰｿﾙ制御  *********************************/
void far GRP_cursor( short toggle ) ;

#ifdef FMR
/***********************  BEEP音を出す(ｶｳﾝﾀ数,指定時間)  *********************/
unsigned GRP_beep( unsigned short time,unsigned short count ) ;
#endif

