打印

keil编写出错帮帮忙

[复制链接]
1939|5
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
顾菲菲916|  楼主 | 2015-11-14 09:58 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
程序是这个但是老是出错
  出现这个ACTION:  PARSING SOURCE-FILE;  ERROR:    PREPROCESSOR: MACROS TOO NESTED
#include<intrins.h>
#include<string.h>
#include<stdlib.h>
#include<stdio.h>
#include<lcd_160128.h>

extern void LCD_Initialise();
extern uchar LCD_Write_Command(uchar cmd);
extern uchar LCD_Write_Command_P1(uchar cmd,uchar para1);
extern uchar LCD_Write_Command_P2(uchar cmd,uchar para1,uchar para2);
extern uchar LCD_Write_Data(uchar dat);
extern void Set_LCD_POS(uchar row,uchar co1) reentrant;
extern void Line(uchar x1,uchar y1,uchar x2,uchar y2,uchar Mode) reentrant;
extern void Draw_Image(uchar*G_Buffer,uchar Start_Row,uchar Start_Co1) reentrant;
extern void Display_Str_at_xy(uchar x,uchar y,char *Buffer,uchar wb) reentrant;
extern void Cls();
void Show_Score_and_Bullet() reentrant;

sbit K1=P1^4;       //上移
sbit K2=P1^5;       //下移
sbit K3=P1^6;       //发射
sbit K4=P1^7;       //重新开始
sbit BEEP=P1^0;     //蜂鸣器

code uchar const Game_Surface[] =       //游戏封面图像160*110
{ 160,110,
   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xFC,0x00,
   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
   0x0E,0x1F,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
   0x00,0x00,0x00,0x00,0x7F,0xDF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,
   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFF,0xFC,0x00,
   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
   0x1F,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
   0x00,0x00,0x00,0x00,0x03,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x7F,0xFF,0x80,0x00,0x00,0x00,0x00,
   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x78,0xFF,0xFF,0xE0,
   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
   0x7F,0xFF,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
   0x00,0x00,0x00,0x00,0x7F,0xFF,0x7F,0xFF,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFE,0x7F,0xFF,0xF0,0x00,0x00,0x00,
   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFF,0xFC,0xFF,
   0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
   0x0F,0xFF,0xFC,0x3F,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
   0x00,0x00,0x00,0x00,0x01,0xFF,0xFC,0x07,0xFF,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,
   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xFF,0x80,0xFF,0xFF,0x00,0x00,
   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xFF,0xF0,
   0x1F,0xFF,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
   0x00,0x00,0xFF,0xFE,0x03,0xFF,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
   0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xFF,0xC0,0x7F,0xFF,0x00,0x00,0x00,0x00,0x00,
   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xFF,0xF8,0x0F,0xFF,0xE0,
   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,
   0xFF,0x01,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
   0x00,0x00,0x00,0x1F,0xFF,0xE0,0x3F,0xFF,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xFF,0xFC,0x0F,0xFF,0xF0,0x00,0x00,0x00,
   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFF,0x01,0xFF,
   0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
   0x0F,0xFF,0xE0,0x3F,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
   0x00,0x00,0x00,0x00,0x01,0xFF,0xFC,0x07,0xFF,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,
   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xFF,0x80,0xFF,0xFE,0x00,0x00,
   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xFF,0xF0,
   0x1F,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
   0x00,0x01,0xFF,0xFE,0x03,0xFF,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
   0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xFF,0xC0,0x7F,0xFF,0x00,0x00,0x00,0x00,0x00,
   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xFF,0xF8,0x0F,0xFF,0xC0,
   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x000x00,0xFF,
   0xFE,0x03,0xFF,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
   0x00,0x00,0x00,0x1F,0xFF,0xC0,0x7F,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xFF,0xF0,0x0F,0xFF,0xE0,0x00,0x00,0x00,
   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFE,0x01,0xFF,
   0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
   0x0F,0xFF,0xC0,0x7F,0xFF,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
   0x00,0x00,0x00,0x00,0x03,0xFF,0xF8,0x0F,0xFF,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,
   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFF,0x01,0xFF,0xFE,0x00,0x00,
   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xFF,0xE0,
   0x3F,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
   0x00,0x03,0xFF,0xFC,0x07,0xFF,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
   0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFF,0x83,0xFF,0xFF,0xFC,0x00,0x00,0x00,0x00,
   0x00,0x00,0x7F,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xFF,0xE7,0xFF,0xFF,0xFF,
   0x07,0x80,0x00,0x00,0x00,0x03,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xFF,
   0xFF,0xFF,0xFF,0xFF,0xCF,0xC0,0x00,0x00,0x00,0x07,0xFF,0xFF,0x80,0x00,0x00,0x00,
   0x00,0x00,0x00,0x3F,0xFF,0xFF,0xFF,0xFF,0xFF,0xC0,0x00,0x00,0x00,0x1F,0xFF,0xFF,
   0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xFF,0xFF,0xFF,0xFF,0xFF,0xE0,0x00,0x00,
   0x00,0x3F,0xFF,0xFF,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFE,0x03,0xFF,
   0xFF,0xE0,0x00,0x00,0x00,0x7F,0xC0,0x07,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
   0x3F,0xFF,0xC0,0x7F,0xFF,0xE0,0x00,0x00,0x00,0xFF,0x00,0x03,0xFC,0x00,0x00,0x00,
   0x00,0x00,0x00,0x00,0x0F,0xFF,0xF8,0x0F,0xFF,0xF0,0x00,0x00,0x01,0xFC,0x00,0x00,
   0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xFF,0xFF,0x01,0xFF,0xFE,0x00,0x00,
   0x01,0xF8,0x00,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x9F,0xFF,0xC0,
   0x3F,0xFF,0x80,0x00,0x03,0xF0,0x00,0x00,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
   0x1F,0x03,0xFF,0xF8,0x0F,0xFF,0xF0,0x00,0x07,0xE0,0x00,0x00,0x1F,0x80,0x00,0x00,
   0x00,0x00,0x00,0x00,0x3F,0x00,0x7F,0xFF,0x07,0xFF,0xFE,0x00,0x07,0xE0,0x00,0x00,
   0x1F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x00,0x0F,0xFF,0xE7,0xFF,0xFE,0x00,
   0x07,0xC0,0x00,0x00,0x0F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x00,0x01,0xFF,
   0xFF,0xFF,0xFE,0x00,0x0F,0xC0,0x00,0x00,0x0F,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,
   0x3E,0x00,0x00,0x7F,0xFF,0xFF,0xFE,0x00,0x0F,0x80,0x00,0x00,0x07,0xC0,0x00,0x00,
   0x00,0x00,0x00,0x00,0x3E,0x00,0x00,0x0F,0xFF,0xFF,0x9E,0x00,0x0F,0x80,0x00,0x00,
   0x07,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x00,0x00,0x01,0xFF,0xFF,0x82,0x00,
   0x0F,0x80,0x00,0x00,0x07,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x00,0x00,
   0x3F,0xFF,0xC0,0x00,0x1F,0x80,0x00,0x00,0x07,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,
   0x1F,0x00,0x00,0x00,0x0F,0xFF,0xF0,0x00,0x0F,0x00,0x00,0x00,0x07,0xC0,0x00,0x00,
   0x00,0x00,0x00,0x00,0x1F,0x80,0x00,0x00,0x1F,0xFF,0xFE,0x00,0x0F,0x80,0x00,0x00,
   0x07,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xC0,0x00,0x00,0x3F,0xFF,0xFE,0x00,
   0x0F,0x80,0x00,0x00,0x07,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xE0,0x00,0x00,
   0x7F,0xFB,0xFE,0x00,0x0F,0x80,0x00,0x00,0x07,0xC0,0x03,0xFF,0xC0,0x00,0x00,0x00,
   0x07,0xF8,0x00,0x01,0xFE,0xFF,0xFE,0x00,0x07,0x80,0x00,0x00,0x07,0x80,0x1F,0xFF,
   0xF8,0x00,0x00,0x00,0x03,0xFE,0x00,0x07,0xFC,0xFF,0xFE,0x00,0x07,0xC0,0x00,0x00,
   0x0F,0x80,0x3F,0xFF,0xFC,0x00,0x00,0x00,0x01,0xFF,0xFF,0xFF,0xF8,0xFF,0xFE,0x00,
   0x07,0xE0,0x00,0x00,0x1F,0x80,0x7F,0xFF,0xFE,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,
   0xF0,0xFF,0xFE,0x00,0x07,0xE0,0x00,0x00,0x1F,0x80,0xFF,0xFF,0xFF,0x00,0x00,0x00,
   0x00,0x3F,0xFF,0xFF,0xC0,0xFF,0xFE,0x00,0x03,0xF0,0x00,0x00,0x3F,0x01,0xFE,0x00,
   0x7F,0x00,0x00,0x00,0x00,0x0F,0xFF,0xFF,0x00,0xFF,0xFF,0x00,0x01,0xF8,0x00,0x00,
   0x7E,0x01,0xF8,0x00,0x1F,0x00,0x00,0x00,0x00,0x03,0xFF,0xF8,0x00,0xFF,0xFF,0x00,
   0x01,0xFC,0x00,0x00,0xFE,0x01,0xF0,0x00,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
   0x00,0x7F,0xFF,0x80,0x00,0xFF,0x00,0x03,0xFC,0x01,0xF0,0x00,0x0F,0x00,0x00,0x00,
   0x00,0x00,0x00,0x00,0x00,0x7F,0xFF,0xC0,0x00,0x7F,0xC0,0x07,0xF8,0x01,0xF8,0x00,
   0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFF,0xC0,0x00,0x3F,0xFF,0xFF,
   0xF0,0x01,0xFE,0x00,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFF,0xE0,
   0x00,0x1F,0xFF,0xFF,0xE0,0x00,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
   0x00,0x7F,0xFF,0xE0,0x00,0x07,0xFF,0xFF,0x80,0x00,0x7F,0xFF,0xFE,0x00,0x00,0x00,
   0x00,0x00,0x00,0x00,0x00,0x7F,0xFF,0xF0,0x00,0x03,0xFF,0xFF,0x00,0x00,0x3F,0xFF,
   0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFF,0xF8,0x00,0x00,0x7F,0xF0,
   0x00,0x00,0x1F,0xFF,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFF,0xF8,
   0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
   0x00,0x7F,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
   0x00,0x00,0x00,0x00,0x00,0x3F,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xFF,0xFC,0x00,0x00,0x00,0x00,
   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xFF,0xFC,
   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
   0x00,0x01,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
   0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xFC,0x00,0x00,0x00,0x00,
   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xF8,
   0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
   0x00,0x00,0x03,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,     
   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
   0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x30,0x00,0x30,0x00,0x30,0xC1,0x80,0x20,0x30,
   0x00,0x21,0x80,0x00,0x0C,0xC0,0x00,0x00,0x00,0x00,0x40,0x30,0x00,0x30,0x00,0x38,
   0xC9,0x80,0x33,0xFF,0x06,0x31,0x80,0x00,0x0D,0xC0,0x00,0x00,0x00,0x01,0xFC,0x30,
   0x07,0xFF,0x00,0x06,0xC9,0x80,0x63,0xFE,0x03,0x89,0xF8,0x0F,0xCE,0x00,0x00,0x00,
   0x00,0x01,0xFB,0xF8,0x07,0xB0,0x00,0x00,0xC9,0x80,0x88,0x40,0x00,0x7E,0x80,0x18,
   0xDF,0xE0,0x00,0x00,0x00,0x01,0x8F,0x3E,0x00,0x30,0x00,0xF8,0xC9,0x81,0xFB,0xF0,
   0x08,0x35,0xF8,0x0C,0xBE,0x00,0x00,0x00,0x00,0x01,0xF9,0x30,0x3F,0xFF,0xF8,0xC8,
   0xC9,0x81,0x25,0xB0,0x0F,0x3C,0x70,0x0F,0xAC,0xC0,0x00,0x00,0x00,0x07,0xF9,0xB0,
   0x3C,0x33,0xF8,0x08,0xC9,0x80,0xCB,0xFE,0x00,0x24,0x60,0x03,0x8D,0x80,0x00,0x00,
   0x00,0x07,0xB8,0xB0,0x02,0x31,0x30,0x18,0xC9,0x81,0xF3,0x30,0x00,0x6F,0xFE,0x03,
   0x87,0x80,0x00,0x00,0x00,0x00,0xE8,0x30,0x02,0x30,0x80,0x1E,0xC9,0x80,0x01,0xB4,
   0x07,0x48,0x20,0x0E,0x47,0x00,0x00,0x00,0x00,0x03,0x88,0x30,0x06,0x30,0x80,0x1D,
   0xC9,0x80,0xFB,0xB3,0x0E,0xC8,0x20,0x3C,0x1F,0x80,0x00,0x00,0x00,0x0F,0x58,0x70,
   0x07,0xFF,0x80,0x3B,0x89,0x83,0xC6,0x31,0xC1,0x98,0x60,0x10,0xFB,0xF8,0x00,0x00,
   0x00,0x00,0x79,0xE0,0x07,0xFF,0xC0,0x37,0x09,0x82,0x19,0xF1,0x82,0x77,0xE0,0x00,
   0x00,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0xE0,
   0x00,0x00,0xC0,0x00,0x00,0x20,0x00,0x00
   };
   uchar code Gun_Image[] =          //枪支图像24*12
{ 24,12,
    0x03,0x00,0x00,0x07,0x80,0x00,0x70,0x80,0x00,0x7F,0xFF,0xFE,0xFF,0xFF,0xFF,0xFF,
    0xFF,0xFC,0x7F,0xFF,0xFC,0x00,0x01,0xFC,0x00,0x01,0xFC,0x00,0x00,0x7F,0x00,0x00,
    0x7F,0x00,0x00,0x1F
   };
   uchar tCount=0;
   uchar HCount,LCount;
   uchar Score=0,Bullet_Count=20;    //得分,剩余弹药数
   uchar Target_x=0,Target_y=0;      //目标物体位置
   uchar Pre_Target_y=0;               //目标物体上次所在纵坐标位置
   uchar gun_y=20;                     //枪支纵坐标,横坐标固定为16*8
   //------------------------------------------------------------------------
   //延时
   //------------------------------------------------------------------------
   void Delay(uint ms)
   {
     uchar i;
     while (--ms) for (i=0;i<120;i++);
    }

   //------------------------------------------------------------------------
   //键盘中断(INT0?
   //------------------------------------------------------------------------
   void EX_INT0() interrupt 0
   {
      //枪支位置上移
      if(K1==0)
      {
        if(gun_y!=0) Display_Str_at_xy(16*8,gun_y," ",0);
        gun_y-=8;
        if(gun_y<20) gun_y=20;
        Draw_Image(Gun_Image,gun_y,16);
        }
        else
        //枪支位置下移
        if(K2==0)
        {
          if(gun_y!=0) Display_Str_at_xy(16*8,gun_y," ",0);
          gun_y+=8;
          if(gun_y>100) gun_y=100;
          Draw_Image(Gun_Image,gun_y,16);
          }
         else
         //发射,模拟枪声,判断成绩
         if(K3==0)
         {
           //如果有剩余弹药则启动T1,模拟枪声并发射
           if(Bullet_Count!=0) TR1 =1;else return;
           //绘制弹道线条
           Line(10,gun_y+4,125,gun_y+4,1);
           Delay(150);
           Line(10,gun_y+4,125,gun_y+4,0);
           //弹药递减
           if(Bullet_Count!=0)
           {
             Bullet_Count--;
             //判断成绩,Pre_Target_y用于保存目标物体上次所在纵坐标位置,
             //避免物体在同一位置被反复多次击中而多次得分
             if ( (gun_y+4)>Target_y&&(gun_y+4 )<Target_y+11&&Pre_Target_y!=Target_y )
             {
               Score++;pre_Target_y=Target_y ;
              }
             }
            //刷新显示成绩与弹药数
            Show_Score_and_Bullet();
            }
            else
            //成绩与弹药数复位
            if (K4==0)
            {
              Score=0;Bullet_Count=20;
              Show_Score_and_Bullet();
              }
             }
   //------------------------------------------------------------------------
   //定时器0控制目标物体随机移动
   //------------------------------------------------------------------------
   void To_INT() interrupt 1
   {
     TH0=-50000/256;
     TL0=-50000%256;
     if(++tCount!=70) return;
     tCount=0;
     //清除原位置目标
     if (Target_x!=0&&Target_y!=0)
     Display_Str_at_xy(Target_x,Target_y," ",0);
     Target_x=rand()%60+8;
     Target_y=rand()%80+20;
     while(abs(Pre_Target_y-Target_y)<4) Target_y=rand()%80+20;
     //在新位置绘制目标物体
     Display_Str_at_xy(Target_x,Target_y,"■",0);
     }
   //------------------------------------------------------------------------
   //定时器1模拟枪声
   //------------------------------------------------------------------------
   void T1_INT() interrupt 3
   {
     BEEP=~BEEP;
     if(LCount!=0)
     {
       TH1=HCount;TL1=--LCount;
       }
      else
      if(--LCount!=0xFB)
     {
       TH1=HCount;TL1=--LCount;
       }
      else
      {
          TH1=HCount=-420/256;
          TL1=LCount=-420%256;
          BEEP=1;
          TR1=0;
       }
     }
   //------------------------------------------------------------------------
   //显示成绩与剩余弹药
   //------------------------------------------------------------------------
   void Show_Score_and_Bullet() reentrant
   {
     char dat_str[4]={' ',0,0,0};
     dat_str[1]=Score/10+'0';
     dat_str[2]=Score%10+'0';
     Display_Str_at_xy(37,117,dat_str,1);
     dat_str[1]=Bullett_Count/10+'0';
     dat_str[2]=Bullett_Count%10+'0';
     Display_Str_at_xy(134,117,dat_str,1);
    }
   //------------------------------------------------------------------------
   //主程序
   //------------------------------------------------------------------------
   void main
   {
     LED_Initialise();                //液晶初始化
     Cls();
     Draw_Image(Game_Surface,6,0);   //显示游戏封面
     Delay(5000);
     Cls();  //显示固定文字
     Display_Str_at_xy(12,1,"★★射击训练游戏★★",1);
     Display_Str_at_xy(2,117,"得分:",0);
     Display_Str_at_xy(75,117,"剩余弹药:",0);//显示成绩与剩余弹药
     Show_Score_and_Bullet();
     //绘制游戏区边框
     Line(0,18,159,18,1);
     Line(159,18,159,112,1);
     Line(159,112,0,112,1);
     Line(0,112,0,18,1);
     //在初始位置绘制枪支
     Draw_Image(Gun_Image,gun_y,16);
     //允许T0,T1,INT0中断
     IE=0x8B;
     IP=0x01;
     IT0=0x01;
     TMOD=0x11;
     TH0=-50000/256;
     TL0=-50000%256;
     TH1=Hcount=-420/256;
     TL1=Lcount=-420%256;
     TR0=1;
     while(1);
     }
     
  

相关帖子

沙发
顾菲菲916|  楼主 | 2015-11-14 09:59 | 只看该作者
//------------------------------------------------------------------------
   //LCE显示控制程序
   //------------------------------------------------------------------------
   struct typFNT_GB16 code GB_16[]={
    "得",0x27,0xc0,0x24,0x40,0x57,0xc0,0x94,0x40,0x27,0xc0,0x60,0x00,
         0xAF,0xE0,0x20,0x80,0x2F,0xE0,0x24,0x80,0x21,0x80,0x00,0x00,
    "分",0x11,0x00,0x11,0x00,0x20,0x80,0x20,0x80,0x40,0x40,0xBF,0xA0,
         0x08,0x80,0x08,0x80,0x10,0x80,0x20,0x80,0xC7,0x00,0x00,0x00,
         /*-- 文字: ★--*/
         /*-- 宋体9; 此字体下对应的点阵为:宽x高=12x12 --*/
         /*--宽度不是8的倍数,现调整为:宽度x高度=16x12 --*/
    "★",0x04,0x00,0x04,0x00,0x0E,0x00,0x0E,0x00,0xFF,0xE0,0x7F,0xC0,
         0x1F,0x00,0x1F,0x00,0x3B,0x80,0x20,0x80,0x40,0x40,0x00,0x00,
         /*-- 文字: ■--* /
         /*-- 宋体9; 此字体下对应的点阵为:宽x高=12x12 --*/
         /*-- 宽度不是8的倍数,现调整为:宽度x高度=16x12 --*/
     "■",0x00,0x00,0x7F,0xC0,0x7F,0xC0,0x7F,0xC0,0x7F,0xC0,0x7F,0xC0,  
         0x7F,0xC0,0x7F,0xC0,0x7F,0xC0,0x7F,0xC0,0x00,0x00,0x00,0x00,
         /*-- 文字: 射--*/
         /*-- 宋体9; 此字体下对应的点阵为:宽x高=12x12 --*/
         /*-- 宽度不是8的倍数,现调整为:宽度x高度=16x12 --*/
     "射",0x20,0x40,0x78,0x40,0x48,0x40,0x7F,0xE0,0x48,0x40,0x7A,0x40,
          0x49,0x40,0xF9,0x40,0x28,0x40,0x48,0x40,0x99,0xC0,0x00,0x00,
         /*-- 文字: 击--*/
         /*-- 宋体9; 此字体下对应的点阵为:宽x高=12x12  --*/
         /*-- 宽度不是8的倍数,现调整为:宽度x高度=16x12 --*/
     "击",0x04,0x00,0x04,0x00,0x7F,0xC0,0x04,0x00,0x04,0x00,0xFF,0xE0,
         0x04,0x00,0x44,0x40,0x44,0x40,0x44,0x40,0x7F,0xC0,0x00,0x00,
         /*-- 文字: 训--*/
         /*-- 宋体9; 此字体下对应的点阵为:宽x高=12x12 --*/
         /*-- 宽度不是8的倍数,现调整为:宽度x高度=16x12 --*/
     "训",0x44,0x40,0x25,0x40,0x05,0x40,0x05,0x40,0xC5,0x40,0x45,0x40,
          0x45,0x40,0x45,0x40,0x55,0x40,0x68,0x40,0x10,0x40,0x00,0x00,
          /*-- 文字:  练--*/
          /*-- 宋体9;  此字体下对应的点阵为:宽x高=12x12 --*/
          /*-- 宽度不是8的倍数,现调整为:宽度x高度=16x12 --*/
      "练",0x22,0x00,0x4F,0xE0,0x42,0x00,0x9F,0x80,0xE4,0x80,0x44,0x80,
           0xAF,0xE0,0xC0,0x80,0x34,0xC0,0xC8,0xA0,0x13,0xA0,0x00,0x00,
           /*-- 文字: 游--*/
           /*-- 宋体9; 此字体下对应的点阵为:宽x高=12x12 --*/
           /*-- 宽度不是8的倍数,现调整为:宽度x高度=16x12 --*/
      "游",0x91,0x00,0x49,0xE0,0x3E,0x00,0x93,0xE0,0x5C,0x40,0x54,0x80,
           0x55,0xE0,0x94,0x80,0x94,0x80,0xA4,0x80,0x4D,0x80,0x00,0x00,
           /*-- 文字: 戏--*/
           /*-- 宋体9; 此字体下对应的点阵为:宽x高=12x12 --*/
           /*-- 宽度不是8的倍数,现调整为:宽度x高度=16x12 --*/
      "戏",0x02,0x80,0xF2,0x40,0x12,0x40,0x13,0xE0,0x9E,0x00,0x52,0x40,
           0x22,0x80,0x31,0x00,0x49,0x20,0x42,0xA0,0x8C,0x60,0x00,0x00,
           /*-- 文字: 剩--*/
           /*-- 宋体9; 此字体下对应的点阵为:宽x高=12x12 --*/
           /*-- 宽度不是8的倍数,现调整为:宽度x高度=16x12 --*/
      "剩",0x7C,0x20,0x10,0xA0,0xFE,0xA0,0x54,0xA0,0xD6,0xA0,0x54,0xA0,
           0xD6,0xA0,0x38,0xA0,0x54,0xA0,0x92,0x20,0x10,0xE0,0x00,0x00,
           /*-- 文字: 余--*/
           /*-- 宋体9; 此字体下对应的点阵为:宽x高=12x12 --*/
           /*-- 宽度不是8的倍数,现调整为:宽度x高度=16x12 --*/
      "余",0x04,0x00,0x0A,0x00,0x11,0x00,0x20,0x80,0xDF,0x60,0x04,0x00,
           0x7F,0xC0,0x15,0x00,0x24,0x80,0x44,0x40,0x9C,0x40,0x00,0x00,
           /*-- 文字: 弹--*/
           /*-- 宋体9; 此字体下对应的点阵为:宽x高=12x12 --*/
           /*-- 宽度不是8的倍数,现调整为:宽度x高度=16x12 --*/
      "弹",0x04,0x40,0xE2,0x80,0x2F,0xC0,0x29,0x40,0xEF,0xC0,0x89,0x40,
           0xEF,0xC0,0x21,0x00,0x3F,0xE0,0x21,0x00,0xC1,0x00,0x00,0x00,
           /*-- 文字: 药--*/
           /*-- 宋体9; 此字体下对应的点阵为:宽x高=12x12 --*/
           /*-- 宽度不是8的倍数,现调整为:宽度x高度=16x12 --*/
      "药",0x11,0x00,0xFF,0xE0,0x11,0x00,0x22,0x00,0x4B,0xE0,0x74,0x20,
           0x22,0x20,0x59,0x20,0x61,0x20,0x18,0x40,0xE1,0xC0,0x00,0x00,
};

//---------------------------------------------------------------------------      
//绘制图像
//---------------------------------------------------------------------------
void Draw_Image(uchar *G_Buffer,uchar Start_Row,uchar Start_CO1) reentrant
{
uchar i,j;
//图像行数控制
for(i=0;i<G_Buffer[1];i++)
{
   Set_LCD_POS(Start_Row+i,Start_Co1);
   LCD_Write_Command(LC_AUT_WR);
   //绘制图像每行像素
   for(j=0;j=G_Buffer[0]/8;j++)
       LCD_Write_Data(G_Buffer[i*(G_Buffer[0]/8)+j+2]);
   LCD_Write_Command(LC_AUT_OVR);
   }
  }

使用特权

评论回复
板凳
keer_zu| | 2015-11-16 08:44 | 只看该作者
顾菲菲916 发表于 2015-11-14 09:59
//------------------------------------------------------------------------
   //LCE显示控制程序
    ...

错误呢?

使用特权

评论回复
地板
Simon21ic| | 2015-11-18 01:39 | 只看该作者
讨论思想的话,一般语言的问题都早就解决了
这个一看错误提示,就是宏嵌套了吧,一眼的问题都很容易解决

使用特权

评论回复
5
我想想| | 2015-11-18 19:18 | 只看该作者
一大段代码吓死人...不如第一句有用....PS:看不懂英文可以左转百度翻译

使用特权

评论回复
6
keer_zu| | 2015-11-19 08:43 | 只看该作者
这个度娘都能解决:
http://zhidao.baidu.com/link?url ... ykIYZ8DKXcN_TFDPxsq

在你的头文件加上 #ifndef xxxx  #define xxxx   #endif  吧

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

1

主题

2

帖子

0

粉丝