* *
*--------------------chess.c----------------------*/ #include \#include \
/*----------------------------------------------------*/ #define RED 7 #define BLACK 14 #define true 1 #define false 0 #define SELECT 0 #define MOVE 1 #define RED_UP 0x1100 #define RED_DOWN 0x1f00 #define RED_LEFT 0x1e00 #define RED_RIGHT 0x2000 #define RED_DO 0x3900 #define RED_UNDO 0x1000
#define BLACK_UP 0x4800 #define BLACK_DOWN 0x5000 #define BLACK_LEFT 0x4b00 #define BLACK_RIGHT 0x4d00 #define BLACK_DO 0x1c00
* *
#define BLACK_UNDO 0x2b00
#define ESCAPE 0x0100
#define RED_JU 1 #define RED_MA 2 #define RED_XIANG 3 #define RED_SHI 4 #define RED_JIANG 5 #define RED_PAO 6 #define RED_BIN 7
#define BLACK_JU 8 #define BLACK_MA 9 #define BLACK_XIANG 10 #define BLACK_SHI 11 #define BLACK_JIANG 12 #define BLACK_PAO 13 #define BLACK_BIN 14
/*----------------------------------------------------*/ int firsttime=1; int savemode;
* *
char page_new=0,page_old=0; int finish=false,turn=BLACK,winner=0; int key;
int redstate=SELECT,blackstate=SELECT; int board[10][9];
/*----------------------------------------------------*/ char *chessfile[15]={\
\\
\\};
char *boardfile[10][9]={
{\\\\\16.wfb\
{\p\\\\26.wfb\
{\\\\\36.wfb\
{\\\\\4t.wfb\
{\
* *
\\\\56.wfb\
{\\\\\66.wfb\
{\\\\\7t.wfb\
{\\\\\86.wfb\
{\\\9t.wfb\
{\\};
char cursor[14][14]={ 0,0,0,0,0,0,0,0,0,0,0,0,1,1, 0,0,0,0,0,0,0,0,0,0,0,1,1,1,
0,255,255,255,255,255,255,255,0,0,1,1,1,1, 0,255,255,255,255,255,255,0,0,1,1,1,1,1, 0,255,255,255,255,255,255,0,0,1,1,1,1,1, 0,255,255,255,255,255,255,255,0,0,1,1,1,1, 0,255,255,255,255,255,255,255,255,0,0,1,1,1, 0,255,255,255,255,255,255,255,255,255,0,0,1,1,
* *
0,255,255,0,255,255,255,255,255,255,255,0,0,1, 0,255,0,1,1,0,255,255,255,255,255,255,255,0, 0,0,1,1,1,1,0,255,255,255,255,255,0,1, 0,1,1,1,1,1,1,0,255,255,255,0,1,1, 1,1,1,1,1,1,1,1,0,255,0,1,1,1, 1,1,1,1,1,1,1,1,1,0,1,1,1,1 };
struct pos{ int x; int y;
}position[10][9],redcurpos,redtemppos,redoldpos,blackcurpos,blacktemppos,blackoldpos;
/*----------------------------------------------------*/ selectpage(register char page) /*换页函数*/ {
union REGS r; r.x.ax=0x4f05; r.x.bx=0;
r.x.dx=page; /*选择页面*/