diff --git a/MCU/MCU_REAL _FINAL/draw.c b/MCU/MCU_REAL _FINAL/draw.c index 11849f7..9314625 100644 --- a/MCU/MCU_REAL _FINAL/draw.c +++ b/MCU/MCU_REAL _FINAL/draw.c @@ -11,8 +11,6 @@ sbit CSA = P2 ^ 4; sbit CSB = P2 ^ 5; -extern Group piece; - void drawNUMBER() { unsigned int j; @@ -397,4 +395,48 @@ void drawSUPNUM(unsigned char x, unsigned char y, unsigned char num) P1 = SUPER_NUM1[8*num+j]; write(); } +} + +void drawGOOD(unsigned char x, unsigned char y) +{ + unsigned int j; + if(x < 0 || x > 127) + return; + else if(x < 64) + { + CSA = 1; + CSB = 0; + } + else + { + x = x - 63; + CSA = 0; + CSB = 1; + } + for(j = 0; j < 8; j++) + { + RS = 0; + RW = 0; + P1 = 0xb8 + y; + write(); + P1 = 0X40 + x + j; + write(); //页y列x+j + + RS = 1; + RW = 0; + P1 = FONT_GOOD0[j]; + write(); + + RS = 0; + RW = 0; + P1 = 0xb8 + y + 1; + write(); + P1 = 0X40 + x + j; + write(); //页y+1列x+j + + RS = 1; + RW = 0; + P1 = FONT_GOOD1[j]; + write(); + } } \ No newline at end of file diff --git a/MCU/MCU_REAL _FINAL/draw.h b/MCU/MCU_REAL _FINAL/draw.h index 6485f35..26bf45d 100644 --- a/MCU/MCU_REAL _FINAL/draw.h +++ b/MCU/MCU_REAL _FINAL/draw.h @@ -10,6 +10,7 @@ void drawSUPNUM(unsigned char x,unsigned char y,unsigned char num); void placeIMG_BLOCK(unsigned char x,unsigned char y); void placeVOID_BLOCK(unsigned char x,unsigned char y); +void drawGOOD(unsigned char x, unsigned char y); void drawBLOCKSCORE(); ////=================== 几何 ================== void drawVerticalDottedLine(char x); diff --git a/MCU/MCU_REAL _FINAL/img.h b/MCU/MCU_REAL _FINAL/img.h index 8ae060c..8b94412 100644 --- a/MCU/MCU_REAL _FINAL/img.h +++ b/MCU/MCU_REAL _FINAL/img.h @@ -87,22 +87,6 @@ code unsigned char MAINMANU_PAGE7[]={ 0x81,0x81,0x41,0x41,0x21,0x11,0x0D,0x03,0x0D,0x11,0x21,0x41,0x41,0x81,0x81,0x00, 0x00,0x00,0x00,0x00,0x00,0x40,0x80,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, }; - -//=================== 方块 ================== -code unsigned char IMG_BLOCK[]={ -/*-- 宽度x高度=8x8 --*/ -0x81,0x7E,0x7E,0x7E,0x7A,0x72,0x7E,0x81, -}; - - -code unsigned char FONT_SCORE0[]={ -0x00,0x10,0x88,0xC4,0x33,0x00,0xBE,0xAA,0xAA,0xAA,0xAA,0xAA,0xBE,0x80,0x00,0x00, -0x80,0x40,0x20,0x90,0x88,0x86,0x80,0x80,0x80,0x83,0x8C,0x10,0x20,0x40,0x80,0x00, -}; -code unsigned char FONT_SCORE1[]={ -0x02,0x01,0x00,0xFF,0x00,0x02,0x0A,0x12,0x02,0x42,0x82,0x7F,0x02,0x02,0x02,0x00, -0x00,0x80,0x40,0x20,0x18,0x07,0x00,0x40,0x80,0x40,0x3F,0x00,0x00,0x00,0x00,0x00, -}; code unsigned char SUPER_NUM0[]={ 0x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00, 0x00,0x00,0x10,0x10,0xF8,0x00,0x00,0x00, @@ -127,4 +111,34 @@ code unsigned char SUPER_NUM1[]={ 0x00,0x1C,0x22,0x21,0x21,0x22,0x1C,0x00, 0x00,0x01,0x12,0x22,0x22,0x11,0x0F,0x00, }; +//=================== 方块字库 ================== +code unsigned char IMG_BLOCK[]={ +/*-- 宽度x高度=8x8 --*/ +0x81,0x7E,0x7E,0x7E,0x7A,0x72,0x7E,0x81, +}; + + +code unsigned char FONT_SCORE0[]={ +0x00,0x10,0x88,0xC4,0x33,0x00,0xBE,0xAA,0xAA,0xAA,0xAA,0xAA,0xBE,0x80,0x00,0x00, +0x80,0x40,0x20,0x90,0x88,0x86,0x80,0x80,0x80,0x83,0x8C,0x10,0x20,0x40,0x80,0x00, +}; +code unsigned char FONT_SCORE1[]={ +0x02,0x01,0x00,0xFF,0x00,0x02,0x0A,0x12,0x02,0x42,0x82,0x7F,0x02,0x02,0x02,0x00, +0x00,0x80,0x40,0x20,0x18,0x07,0x00,0x40,0x80,0x40,0x3F,0x00,0x00,0x00,0x00,0x00, +}; + +code unsigned char FONT_GOOD0[]={ +0xC0,0x30,0x08,0x08,0x08,0x38,0x00,0x00, +0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00, +0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00, +0x00,0x00,0x80,0x80,0x80,0x90,0xF0,0x00, +0x00,0x00,0x00,0xF8,0x00,0x00,0x00,0x00, +}; +code unsigned char FONT_GOOD1[]={ +0x07,0x18,0x20,0x20,0x22,0x1E,0x02,0x00, +0x00,0x1F,0x20,0x20,0x20,0x20,0x1F,0x00, +0x00,0x1F,0x20,0x20,0x20,0x20,0x1F,0x00, +0x00,0x1F,0x20,0x20,0x20,0x10,0x3F,0x20, +0x00,0x00,0x00,0x33,0x00,0x00,0x00,0x00, +}; #endif \ No newline at end of file