2022-05-25 07:12:42 +00:00
|
|
|
|
#include "img.h"
|
|
|
|
|
#include "display.h"
|
|
|
|
|
#include "draw.h"
|
|
|
|
|
#include <reg52.h>
|
2022-06-05 15:35:53 +00:00
|
|
|
|
#include "block.h"
|
2022-05-25 07:12:42 +00:00
|
|
|
|
|
2022-06-04 14:37:33 +00:00
|
|
|
|
sbit RS = P2 ^ 0;
|
|
|
|
|
sbit RW = P2 ^ 1;
|
|
|
|
|
sbit E = P2 ^ 2;
|
|
|
|
|
sbit CSA = P2 ^ 4;
|
|
|
|
|
sbit CSB = P2 ^ 5;
|
2022-05-25 07:12:42 +00:00
|
|
|
|
|
2022-06-05 15:35:53 +00:00
|
|
|
|
|
|
|
|
|
extern Group piece;
|
|
|
|
|
|
2022-05-25 07:12:42 +00:00
|
|
|
|
void drawNUMBER()
|
|
|
|
|
{
|
2022-06-05 13:03:15 +00:00
|
|
|
|
unsigned int j;
|
|
|
|
|
for(j = 0 ; j < 64; j++)
|
2022-05-25 07:12:42 +00:00
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
CSA = 1;
|
|
|
|
|
CSB = 0;
|
|
|
|
|
RS = 0;
|
|
|
|
|
RW = 0;
|
|
|
|
|
P1 = 0xb8 + 2;
|
|
|
|
|
write();
|
|
|
|
|
P1 = 0X40 + j;
|
|
|
|
|
write(); //ҳ2<D2B3><32>j<EFBFBD><6A>A
|
|
|
|
|
|
|
|
|
|
RS = 1;
|
|
|
|
|
RW = 0;
|
2022-06-05 15:35:53 +00:00
|
|
|
|
P1 = NUMBER_PAGE0[j];
|
2022-05-25 07:12:42 +00:00
|
|
|
|
write();
|
|
|
|
|
|
|
|
|
|
RS = 0;
|
|
|
|
|
RW = 0;
|
|
|
|
|
P1 = 0xb8 + 3;
|
|
|
|
|
write();
|
|
|
|
|
P1 = 0X40 + j;
|
|
|
|
|
write(); //ҳ3<D2B3><33>j<EFBFBD><6A>A
|
|
|
|
|
|
|
|
|
|
RS = 1;
|
|
|
|
|
RW = 0;
|
2022-06-05 15:35:53 +00:00
|
|
|
|
P1 = NUMBER_PAGE1[j];
|
2022-05-25 07:12:42 +00:00
|
|
|
|
write();
|
|
|
|
|
|
|
|
|
|
}
|
2022-06-05 13:03:15 +00:00
|
|
|
|
for(j = 0 ; j < 16; j++)
|
2022-05-25 07:12:42 +00:00
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CSA = 0;
|
|
|
|
|
CSB = 1;
|
|
|
|
|
RS = 0;
|
|
|
|
|
RW = 0;
|
|
|
|
|
P1 = 0xb8 + 2;
|
|
|
|
|
write();
|
|
|
|
|
P1 = 0X40 + j;
|
2022-06-04 14:15:13 +00:00
|
|
|
|
write(); //ҳ2<D2B3><32>j<EFBFBD><6A>B
|
2022-05-25 07:12:42 +00:00
|
|
|
|
|
|
|
|
|
RS = 1;
|
|
|
|
|
RW = 0;
|
2022-06-05 15:35:53 +00:00
|
|
|
|
P1 = NUMBER_RPAGE0[j];
|
2022-05-25 07:12:42 +00:00
|
|
|
|
write();
|
|
|
|
|
|
|
|
|
|
RS = 0;
|
|
|
|
|
RW = 0;
|
|
|
|
|
P1 = 0xb8 + 3;
|
|
|
|
|
write();
|
|
|
|
|
P1 = 0X40 + j;
|
2022-06-04 14:15:13 +00:00
|
|
|
|
write(); //ҳ3<D2B3><33>j<EFBFBD><6A>B
|
2022-05-25 07:12:42 +00:00
|
|
|
|
|
|
|
|
|
RS = 1;
|
|
|
|
|
RW = 0;
|
2022-06-05 15:35:53 +00:00
|
|
|
|
P1 = NUMBER_RPAGE1[j];
|
2022-05-25 07:12:42 +00:00
|
|
|
|
write();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void drawNAME()
|
|
|
|
|
{
|
|
|
|
|
unsigned int j;
|
|
|
|
|
|
|
|
|
|
for(j = 0; j < 48; j++)
|
|
|
|
|
{
|
|
|
|
|
CSA = 1;
|
|
|
|
|
CSB = 0;
|
|
|
|
|
RS = 0;
|
|
|
|
|
RW = 0;
|
|
|
|
|
P1 = 0xb8 + 0;
|
|
|
|
|
write();
|
|
|
|
|
P1 = 0X40 + j;
|
|
|
|
|
write(); //ҳ0<D2B3><30>j<EFBFBD><6A>A
|
|
|
|
|
|
|
|
|
|
RS = 1;
|
|
|
|
|
RW = 0;
|
2022-06-05 15:35:53 +00:00
|
|
|
|
P1 = NAME_PAGE0[j];
|
2022-05-25 07:12:42 +00:00
|
|
|
|
write();
|
|
|
|
|
|
|
|
|
|
RS = 0;
|
|
|
|
|
RW = 0;
|
|
|
|
|
P1 = 0xb8 + 1;
|
|
|
|
|
write();
|
|
|
|
|
P1 = 0X40 + j;
|
|
|
|
|
write(); //ҳ1<D2B3><31>j<EFBFBD><6A>A
|
|
|
|
|
|
|
|
|
|
RS = 1;
|
|
|
|
|
RW = 0;
|
2022-06-05 15:35:53 +00:00
|
|
|
|
P1 = NAME_PAGE1[j];
|
2022-05-25 07:12:42 +00:00
|
|
|
|
write();
|
2022-06-04 14:15:13 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2022-06-05 13:03:15 +00:00
|
|
|
|
void drawMAINMENU(unsigned char i)
|
2022-06-04 14:15:13 +00:00
|
|
|
|
{
|
2022-06-05 12:26:03 +00:00
|
|
|
|
unsigned int j;
|
2022-06-04 14:15:13 +00:00
|
|
|
|
|
2022-06-05 12:26:03 +00:00
|
|
|
|
for(j = 0; j < 32; j++)
|
2022-06-04 14:15:13 +00:00
|
|
|
|
{
|
2022-06-05 13:03:15 +00:00
|
|
|
|
CSA = 0;
|
|
|
|
|
CSB = 1;
|
2022-05-25 07:12:42 +00:00
|
|
|
|
|
2022-06-04 14:15:13 +00:00
|
|
|
|
RS = 0;
|
|
|
|
|
RW = 0;
|
2022-06-05 12:26:03 +00:00
|
|
|
|
P1 = 0xb8 + 0;
|
|
|
|
|
write();
|
2022-06-05 13:03:15 +00:00
|
|
|
|
P1 = 0X40 + 31 + j;
|
|
|
|
|
write(); //ҳ0<D2B3><30>31+j<><6A>B
|
2022-06-05 12:26:03 +00:00
|
|
|
|
|
|
|
|
|
RS = 1;
|
|
|
|
|
RW = 0;
|
2022-06-05 15:35:53 +00:00
|
|
|
|
P1 = MAINMANU_PAGE0[j];
|
2022-06-05 12:26:03 +00:00
|
|
|
|
write();
|
|
|
|
|
|
|
|
|
|
RS = 0;
|
|
|
|
|
RW = 0;
|
|
|
|
|
P1 = 0xb8 + 1;
|
2022-06-04 14:15:13 +00:00
|
|
|
|
write();
|
2022-06-05 13:03:15 +00:00
|
|
|
|
P1 = 0X40 + 31 + j;
|
|
|
|
|
write(); //ҳ1<D2B3><31>31+j<><6A>B
|
2022-05-25 07:12:42 +00:00
|
|
|
|
|
2022-06-04 14:15:13 +00:00
|
|
|
|
RS = 1;
|
|
|
|
|
RW = 0;
|
2022-06-05 15:35:53 +00:00
|
|
|
|
P1 = MAINMANU_PAGE1[j];
|
2022-06-04 14:15:13 +00:00
|
|
|
|
write();
|
2022-06-05 13:03:15 +00:00
|
|
|
|
|
|
|
|
|
CSA = 1;
|
|
|
|
|
CSB = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RS = 0;
|
|
|
|
|
RW = 0;
|
|
|
|
|
P1 = 0xb8 + 2;
|
|
|
|
|
write();
|
|
|
|
|
P1 = 0X40 + j;
|
|
|
|
|
write(); //ҳ2<D2B3><32>j<EFBFBD><6A>A
|
|
|
|
|
|
|
|
|
|
RS = 1;
|
|
|
|
|
RW = 0;
|
|
|
|
|
if(i==1)
|
2022-06-05 15:35:53 +00:00
|
|
|
|
P1 = ~MAINMANU_PAGE2[j];
|
2022-06-05 13:03:15 +00:00
|
|
|
|
else
|
2022-06-05 15:35:53 +00:00
|
|
|
|
P1 = MAINMANU_PAGE2[j];
|
2022-06-05 13:03:15 +00:00
|
|
|
|
write();
|
|
|
|
|
|
|
|
|
|
RS = 0;
|
|
|
|
|
RW = 0;
|
|
|
|
|
P1 = 0xb8 + 3;
|
|
|
|
|
write();
|
|
|
|
|
P1 = 0X40 + j;
|
|
|
|
|
write(); //ҳ3<D2B3><33>j<EFBFBD><6A>A
|
|
|
|
|
|
|
|
|
|
RS = 1;
|
|
|
|
|
RW = 0;
|
|
|
|
|
if(i==1)
|
2022-06-05 15:35:53 +00:00
|
|
|
|
P1 = ~MAINMANU_PAGE3[j];
|
2022-06-05 13:03:15 +00:00
|
|
|
|
else
|
2022-06-05 15:35:53 +00:00
|
|
|
|
P1 = MAINMANU_PAGE3[j];
|
2022-06-05 13:03:15 +00:00
|
|
|
|
write();
|
|
|
|
|
|
|
|
|
|
RS = 0;
|
|
|
|
|
RW = 0;
|
|
|
|
|
P1 = 0xb8 + 4;
|
|
|
|
|
write();
|
|
|
|
|
P1 = 0X40 + j;
|
|
|
|
|
write(); //ҳ4<D2B3><34>j<EFBFBD><6A>A
|
|
|
|
|
|
|
|
|
|
RS = 1;
|
|
|
|
|
RW = 0;
|
|
|
|
|
if(i==2)
|
2022-06-05 15:35:53 +00:00
|
|
|
|
P1 = ~MAINMANU_PAGE4[j];
|
2022-06-05 13:03:15 +00:00
|
|
|
|
else
|
2022-06-05 15:35:53 +00:00
|
|
|
|
P1 = MAINMANU_PAGE4[j];
|
2022-06-05 13:03:15 +00:00
|
|
|
|
write();
|
|
|
|
|
|
|
|
|
|
RS = 0;
|
|
|
|
|
RW = 0;
|
|
|
|
|
P1 = 0xb8 + 5;
|
|
|
|
|
write();
|
|
|
|
|
P1 = 0X40 + j;
|
|
|
|
|
write(); //ҳ5<D2B3><35>j<EFBFBD><6A>A
|
|
|
|
|
|
|
|
|
|
RS = 1;
|
|
|
|
|
RW = 0;
|
|
|
|
|
if(i==2)
|
2022-06-05 15:35:53 +00:00
|
|
|
|
P1 = ~MAINMANU_PAGE5[j];
|
2022-06-05 13:03:15 +00:00
|
|
|
|
else
|
2022-06-05 15:35:53 +00:00
|
|
|
|
P1 = MAINMANU_PAGE5[j];
|
2022-06-05 13:03:15 +00:00
|
|
|
|
write();
|
|
|
|
|
|
|
|
|
|
RS = 0;
|
|
|
|
|
RW = 0;
|
|
|
|
|
P1 = 0xb8 + 6;
|
|
|
|
|
write();
|
|
|
|
|
P1 = 0X40 + j;
|
|
|
|
|
write(); //ҳ6<D2B3><36>j<EFBFBD><6A>A
|
|
|
|
|
|
|
|
|
|
RS = 1;
|
|
|
|
|
RW = 0;
|
|
|
|
|
if(i==3)
|
2022-06-05 15:35:53 +00:00
|
|
|
|
P1 = ~MAINMANU_PAGE6[j];
|
2022-06-05 13:03:15 +00:00
|
|
|
|
else
|
2022-06-05 15:35:53 +00:00
|
|
|
|
P1 = MAINMANU_PAGE6[j];
|
2022-06-05 13:03:15 +00:00
|
|
|
|
write();
|
|
|
|
|
|
|
|
|
|
RS = 0;
|
|
|
|
|
RW = 0;
|
|
|
|
|
P1 = 0xb8 + 7;
|
|
|
|
|
write();
|
|
|
|
|
P1 = 0X40 + j;
|
|
|
|
|
write(); //ҳ7<D2B3><37>j<EFBFBD><6A>A
|
|
|
|
|
|
|
|
|
|
RS = 1;
|
|
|
|
|
RW = 0;
|
|
|
|
|
if(i==3)
|
2022-06-05 15:35:53 +00:00
|
|
|
|
P1 = ~MAINMANU_PAGE7[j];
|
2022-06-05 13:03:15 +00:00
|
|
|
|
else
|
2022-06-05 15:35:53 +00:00
|
|
|
|
P1 = MAINMANU_PAGE7[j];
|
2022-06-05 13:03:15 +00:00
|
|
|
|
write();
|
2022-05-25 07:12:42 +00:00
|
|
|
|
}
|
2022-06-05 13:03:15 +00:00
|
|
|
|
|
2022-06-05 15:35:53 +00:00
|
|
|
|
}
|
|
|
|
|
void placeIMG_BLOCK(unsigned char x,unsigned char y)
|
|
|
|
|
{
|
|
|
|
|
unsigned int j;
|
|
|
|
|
for(j = 0 ; j < 8; j++)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
CSA = 1;
|
|
|
|
|
CSB = 0;
|
|
|
|
|
RS = 0;
|
|
|
|
|
RW = 0;
|
|
|
|
|
P1 = 0xb8 + 7 - y;
|
|
|
|
|
write();
|
|
|
|
|
P1 = 0X40 + x*8 + j;
|
|
|
|
|
write(); //ҳ7-y<><79>x*8+j<><6A>A
|
|
|
|
|
|
|
|
|
|
RS = 1;
|
|
|
|
|
RW = 0;
|
|
|
|
|
P1 = IMG_BLOCK[j];
|
|
|
|
|
write();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|