/*/<H> pfwwdx.h ////////////////////////////////[PastelFantasyWW DX]///
//                    パステルファンタジーDeluxe
//                         for WonderWitch
//                          Version 1.00
//                       《ヘッダファイル》
//                   Copyright(C) K.Shimizu 2001
///////////////////////////////////////////////////////////////////*/

/*インクルードチェック//-------------------------------------------*/
#ifndef __PFWWDX_H
#define __PFWWDX_H

/*外部ヘッダのインクルード//---------------------------------------*/
#include <sys/bios.h>
#include <sys/oswork.h>
#include <sys/libwwc.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "il_sound.h"

/*#define KSWWRES_MAXRES 16*/
#include "kswwres.h"

/*マクロ宣言//-----------------------------------------------------*/
#define _heap		(_pc->_heap)		/* ヒープ領域の先頭アドレス */
#define HEAP_SIZE	(-(int)_heap)		/* ヒープ領域のサイズ */

/*定数宣言//-------------------------------------------------------*/
/* 一般 */
#define PF_VERSION	"0.00"	/* バージョン */
#define PF_FILE_EXT	".pfs"	/* データファイルの拡張子 */
#define PF_WIDTH	12		/* フィールドの幅 */
#define PF_HEIGHT	8		/* フィールドの高さ */
#define MAX_STAGE	16		/* 最大ステージ数 */

/* リソース番号 */
#define PF_RES_ICON			0	/* Ged用アイコン(4色グレースケール) */
#define PF_RES_FRAME16		1	/* ウィンドウ枠(16色) */
#define PF_RES_FRAME4G		2	/* ウィンドウ枠(4色グレースケール) */
#define PF_RES_MAIN16		3	/* メイン画像(16色) */
#define PF_RES_MAIN4G		4	/* メイン画像(4色グレースケール) */
#define PF_RES_BGM1			5	/* タイトルBGM */
#define PF_RES_BGM2			6	/* ステージBGM */
#define PF_RES_SE			7	/* 効果音 */

/* フォント番号 */
#define PF_FONT_FRAME	1						/* ウィンドウ枠 */
#define PF_FONT_CHAR	(PF_FONT_FRAME + 8)		/* キャラクタ */
#define PF_FONT_CHECK	(PF_FONT_CHAR + 24)		/* チェック枠 */
#define PF_FONT_STAR	(PF_FONT_CHECK + 4)		/* 星 */
#define PF_FONT_CURSOR	(PF_FONT_STAR + 1)		/* カーソル */
#define PF_FONT_TILE	(PF_FONT_CURSOR + 2)	/* タイル */
#define PF_FONT_TITLE	(PF_FONT_TILE + 5)		/* タイトル文字 */
#define PF_FONT_CLEAR	(PF_FONT_TITLE + 48)	/* クリア文字 */
#define PF_FONT_STRING	(PF_FONT_CLEAR + 24)	/* DrawString用 */

/* パレット番号 */
#define PF_PAL_SCREEN	0		/* スクリーン */
#define PF_PAL_CURSOR	12		/* カーソル */

/* 効果音 */
#define PF_SE_PU			0	/* ぷ(チェック) */
#define PF_SE_PUPE			1	/* ぷぺ(クリア)*/
#define PF_SE_PIPO			2	/* ぴぽ(ステージ切り替え) */
#define PF_SE_GAMESTART		3	/* ゲームスタート */
#define PF_SE_STAGECLEAR	4	/* ステージクリア */

/*構造体宣言//-----------------------------------------------------*/

/*関数プロトタイプ//-----------------------------------------------*/
void	Init();								/* 初期化処理 */
void	InitFont();							/* フォント設定 */
BOOL	SelectFile(char *pszFileName);		/* ファイルを選択 */
BOOL	LoadDataFile(char *pszFileName);	/* データファイル読み込み */
BOOL	GetLine(char *pszBuf, FILE far *fp);	/* データファイルから１行取得 */
BOOL	ProcTitle();						/* タイトル処理 */
void	LoadStage(int nStage);				/* ステージデータ読み込み */
BOOL	ProcStage();						/* ステージ中の処理 */
void	ClearChar();						/* キャラクタをクリアする処理 */
void	FallChar();							/* キャラクタの落下処理 */
void	StageClear();						/* ステージクリア処理 */
void	DrawChar(int nScreen, int nX, int nY,			/* キャラクタをキャラクタ座標指定で表示 */
					int nChar);
void	DrawCharAtRawPos(int nScreen,int nX, int nY,	/* キャラクタを絶対座標指定で表示 */
					int nChar);
void	CheckChar(int nScreen, int nX, int nY, BOOL bCheck);	/* キャラクタにチェックを入れる */
void	DrawField();									/* フィールド全体を表示 */
void	DrawWndFrame(int nScreen, int nX1, int nY1,		/* ウィンドウ枠を表示 */
						int nX2, int nY2, BOOL bClear);
void	DrawString(int nScreen, int nX, int nY,			/* 文字列を表示 */
					char *pszStr, BOOL bReset);
void	DrawStringFrom(int nScreen, int nX, int nY,		/* フォント番号を指定して文字列を表示 */
					char *pszStr, int nFont);
void	SetTextFont16Packed(WORD wCode, int nFont);		/* 文字を 16色パックトフォントで設定 */
void	SetTextFontColor(WORD wCode, int nFont);		/* 文字を 4色グレースケールフォントで設定 */
BOOL	IsSjis1st(BYTE byByte);							/* ShiftJISの 1バイト目か調べる */
void	BgmPlay(int nRes, WORD wMode);					/* BGMを再生 */
void	SePlayN(int n);									/* 効果音を再生 */
int		atoi(char *pszStr);								/* 文字列を整数に変換 */

/*-----------------------------------------------------------------*/

#endif	// __PFWWDX_H

/*/[EOF] pfwwdx.h /////////////////////////////////////////////////*/
