feat(MCU课设): 方块:加一些有趣的东西
This commit is contained in:
parent
2238d190c6
commit
2bb187635c
3 changed files with 75 additions and 18 deletions
|
@ -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();
|
||||
}
|
||||
}
|
|
@ -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);
|
||||
|
|
|
@ -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
|
Reference in a new issue