加了一堆东西但至少现在应该是好用的

This commit is contained in:
iridiumR 2022-06-04 22:15:13 +08:00
parent 20bb7dbf92
commit 75163ba8bf
19 changed files with 1017 additions and 467 deletions

Binary file not shown.

View file

@ -0,0 +1,84 @@
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<WORKSPACE>
<FRAME activewindow="0">
<PLACEMENT>2c00000002000000030000000083ffff0083ffffffffffffffffffff2701000089000000b7050000b6030000</PLACEMENT>
<WINDOW type="default" module="ISIS"/>
<WINDOW type="device" module="LIBMAN"/>
<WINDOW type="default" module="VSMSTUDIO">
<STATE NAME="EDIT" VALUE="AAAA/wAAAAH9AAAAAgAAAAAAAAEAAAAC5PwCAAAAAvsAAAAQAFAAcgBvAGoAZQBjAHQAcwEAAAAAAAAC5AAAASwA////+wAAABQAUAByAG8AcABlAHIAdABpAGUAcwAAAAAA/////wAAAHAA////AAAAAwAAB3gAAAB1/AEAAAAB/AAAAAAAAAd4AAAAWgD////6AAAAAAEAAAAW+wAAACAATwB1AHQAcAB1AHQARABvAGMAawBXAGkAZABnAGUAdAEAAAAA/////wAAAFoA////+wAAACoAZABvAGMAawA6ADAAOgBTAGkAbQB1AGwAYQB0AGkAbwBuACAATABvAGcAAAAAAP////8AAAAAAAAAAPsAAAAmAGQAbwBjAGsAOgAxADoAVwBhAHQAYwBoACAAVwBpAG4AZABvAHcAAAAAAP////8AAAAAAAAAAPsAAABYAGQAbwBjAGsAOgAyADUANgA6AEsAUwAwADEAMAA4AEIAIABMAEMARAAgAEMAbwBuAHQAcgBvAGwAbABlAHIAIAAxACAAUgBBAE0AIAAtACAATABDAEQAMQAAAAAA/////wAAAAAAAAAA+wAAAFgAZABvAGMAawA6ADIANQA3ADoASwBTADAAMQAwADgAQgAgAEwAQwBEACAAQwBvAG4AdAByAG8AbABsAGUAcgAgADIAIABSAEEATQAgAC0AIABMAEMARAAxAAAAAAD/////AAAAAAAAAAD7AAAAPABkAG8AYwBrADoAMQA6ADgAMAA1ADEAIABDAFAAVQAgAFIAZQBnAGkAcwB0AGUAcgBzACAALQAgAFUAMQAAAAAA/////wAAAAAAAAAA+wAAAFgAZABvAGMAawA6ADMAOgA4ADAANQAxACAAQwBQAFUAIABJAG4AdABlAHIAbgBhAGwAIAAoAEkARABBAFQAQQApACAATQBlAG0AbwByAHkAIAAtACAAVQAxAAAAAAD/////AAAAAAAAAAD7AAAAPgBkAG8AYwBrADoAMgA6ADgAMAA1ADEAIABDAFAAVQAgAFMARgBSACAATQBlAG0AbwByAHkAIAAtACAAVQAxAAAAAAD/////AAAAAAAAAAD7AAAAKgBkAG8AYwBrADoAMAA6AFMAaQBtAHUAbABhAHQAaQBvAG4AIABMAG8AZwAAAAAA/////wAAAAAAAAAA+wAAACYAZABvAGMAawA6ADEAOgBXAGEAdABjAGgAIABXAGkAbgBkAG8AdwAAAAAA/////wAAAAAAAAAA+wAAAFgAZABvAGMAawA6ADIANQA2ADoASwBTADAAMQAwADgAQgAgAEwAQwBEACAAQwBvAG4AdAByAG8AbABsAGUAcgAgADEAIABSAEEATQAgAC0AIABMAEMARAAxAAAAAAD/////AAAAAAAAAAD7AAAAWABkAG8AYwBrADoAMgA1ADcAOgBLAFMAMAAxADAAOABCACAATABDAEQAIABDAG8AbgB0AHIAbwBsAGwAZQByACAAMgAgAFIAQQBNACAALQAgAEwAQwBEADEAAAAAAP////8AAAAAAAAAAPsAAAA8AGQAbwBjAGsAOgAxADoAOAAwADUAMQAgAEMAUABVACAAUgBlAGcAaQBzAHQAZQByAHMAIAAtACAAVQAxAAAAAAD/////AAAAAAAAAAD7AAAAWABkAG8AYwBrADoAMwA6ADgAMAA1ADEAIABDAFAAVQAgAEkAbgB0AGUAcgBuAGEAbAAgACgASQBEAEEAVABBACkAIABNAGUAbQBvAHIAeQAgAC0AIABVADEAAAAAAP////8AAAAAAAAAAPsAAAA+AGQAbwBjAGsAOgAyADoAOAAwADUAMQAgAEMAUABVACAAUwBGAFIAIABNAGUAbQBvAHIAeQAgAC0AIABVADEAAAAAAP////8AAAAAAAAAAPsAAAAqAGQAbwBjAGsAOgAwADoAUwBpAG0AdQBsAGEAdABpAG8AbgAgAEwAbwBnAAAAAAD/////AAAAAAAAAAD7AAAAJgBkAG8AYwBrADoAMQA6AFcAYQB0AGMAaAAgAFcAaQBuAGQAbwB3AAAAAAD/////AAAAAAAAAAD7AAAAWABkAG8AYwBrADoAMgA1ADYAOgBLAFMAMAAxADAAOABCACAATABDAEQAIABDAG8AbgB0AHIAbwBsAGwAZQByACAAMQAgAFIAQQBNACAALQAgAEwAQwBEADEAAAAAAP////8AAAAAAAAAAPsAAABYAGQAbwBjAGsAOgAyADUANwA6AEsAUwAwADEAMAA4AEIAIABMAEMARAAgAEMAbwBuAHQAcgBvAGwAbABlAHIAIAAyACAAUgBBAE0AIAAtACAATABDAEQAMQAAAAAA/////wAAAAAAAAAA+wAAADwAZABvAGMAawA6ADEAOgA4ADAANQAxACAAQwBQAFUAIABSAGUAZwBpAHMAdABlAHIAcwAgAC0AIABVADEAAAAAAP////8AAAAAAAAAAPsAAABYAGQAbwBjAGsAOgAzADoAOAAwADUAMQAgAEMAUABVACAASQBuAHQAZQByAG4AYQBsACAAKABJAEQAQQBUAEEAKQAgAE0AZQBtAG8AcgB5ACAALQAgAFUAMQAAAAAA/////wAAAAAAAAAA+wAAAD4AZABvAGMAawA6ADIAOgA4ADAANQAxACAAQwBQAFUAIABTAEYAUgAgAE0AZQBtAG8AcgB5ACAALQAgAFUAMQAAAAAA/////wAAAAAAAAAAAAAGcwAAAuQAAAABAAAAAgAAAAgAAAAC/AAAAAA="/>
<STATE NAME="DEBUG" VALUE="AAAA/wAAAAH9AAAAAgAAAAAAAAEAAAAC5PwCAAAAAvsAAAAQAFAAcgBvAGoAZQBjAHQAcwAAAAAAAAAC5AAAASwA////+wAAABQAUAByAG8AcABlAHIAdABpAGUAcwAAAAAA/////wAAAHAA////AAAAAwAAB3gAAAB1/AEAAAAB/AAAAAAAAAd4AAAAAAD////6/////wEAAAAI+wAAACAATwB1AHQAcAB1AHQARABvAGMAawBXAGkAZABnAGUAdAAAAAAA/////wAAAFoA////+wAAACoAZABvAGMAawA6ADAAOgBTAGkAbQB1AGwAYQB0AGkAbwBuACAATABvAGcAAAAAAP////8AAAGSAP////sAAAAmAGQAbwBjAGsAOgAxADoAVwBhAHQAYwBoACAAVwBpAG4AZABvAHcAAAAAAP////8AAAFgAP////sAAABYAGQAbwBjAGsAOgAyADUANgA6AEsAUwAwADEAMAA4AEIAIABMAEMARAAgAEMAbwBuAHQAcgBvAGwAbABlAHIAIAAxACAAUgBBAE0AIAAtACAATABDAEQAMQAAAAAA/////wAAAFoA////+wAAAFgAZABvAGMAawA6ADIANQA3ADoASwBTADAAMQAwADgAQgAgAEwAQwBEACAAQwBvAG4AdAByAG8AbABsAGUAcgAgADIAIABSAEEATQAgAC0AIABMAEMARAAxAAAAAAD/////AAAAWgD////7AAAAPABkAG8AYwBrADoAMQA6ADgAMAA1ADEAIABDAFAAVQAgAFIAZQBnAGkAcwB0AGUAcgBzACAALQAgAFUAMQAAAAAA/////wAAAFoA////+wAAAFgAZABvAGMAawA6ADMAOgA4ADAANQAxACAAQwBQAFUAIABJAG4AdABlAHIAbgBhAGwAIAAoAEkARABBAFQAQQApACAATQBlAG0AbwByAHkAIAAtACAAVQAxAAAAAAD/////AAAAWgD////7AAAAPgBkAG8AYwBrADoAMgA6ADgAMAA1ADEAIABDAFAAVQAgAFMARgBSACAATQBlAG0AbwByAHkAIAAtACAAVQAxAAAAAAD/////AAAAWgD///8AAAd4AAADXgAAAAEAAAACAAAACAAAAAL8AAAAAA=="/>
</WINDOW>
</FRAME>
<MODULE name="VSMDEBUG">
<PWI>
<POPUP w="400" x="-31995" flags="00000002" y="-31921" h="100" pid="0" iid="-1">
<PROPERTIES>
<ITEM name="Message Column Width">279</ITEM>
<ITEM name="ShowGrid">No</ITEM>
<ITEM name="Source Column Width">100</ITEM>
<ITEM name="Version">100</ITEM>
</PROPERTIES>
</POPUP>
<POPUP w="350" x="-31995" flags="00000032" y="-31921" h="100" pid="1" iid="-1">
<PROPERTIES>
<ITEM name="Address Column Width">87</ITEM>
<ITEM name="AutoResize">No</ITEM>
<ITEM name="Gridlines">Yes</ITEM>
<ITEM name="Name Column Width">87</ITEM>
<ITEM name="ShowAddresses">Yes</ITEM>
<ITEM name="ShowPreviousValues">No</ITEM>
<ITEM name="ShowTypes">No</ITEM>
<ITEM name="ShowWatchPoint">Yes</ITEM>
<ITEM name="TriggerMode">0</ITEM>
<ITEM name="Value Column Width">87</ITEM>
<ITEM name="Version">100</ITEM>
<ITEM name="Watch Expression Column Width">87</ITEM>
<ITEM name="nItems">0</ITEM>
</PROPERTIES>
</POPUP>
<POPUP w="1" x="-31995" flags="0000000a" y="-31921" h="1" pid="256" iid="1">
<PROPERTIES>
<ITEM name="DataType">2</ITEM>
<ITEM name="DispChars">Yes</ITEM>
<ITEM name="DispFormat">2</ITEM>
<ITEM name="ShowChanges">Yes</ITEM>
<ITEM name="ShowToolTips">Yes</ITEM>
<ITEM name="TopLineAddress">00000000</ITEM>
</PROPERTIES>
</POPUP>
<POPUP w="1" x="-31995" flags="0000000a" y="-31921" h="1" pid="257" iid="1">
<PROPERTIES>
<ITEM name="DataType">2</ITEM>
<ITEM name="DispChars">Yes</ITEM>
<ITEM name="DispFormat">2</ITEM>
<ITEM name="ShowChanges">Yes</ITEM>
<ITEM name="ShowToolTips">Yes</ITEM>
<ITEM name="TopLineAddress">00000000</ITEM>
</PROPERTIES>
</POPUP>
<POPUP w="98" x="-31995" flags="00000008" y="-31921" h="28" pid="1" iid="2">
<PROPERTIES/>
</POPUP>
<POPUP w="1" x="-31995" flags="0000000a" y="-31921" h="1" pid="3" iid="2">
<PROPERTIES>
<ITEM name="DataType">2</ITEM>
<ITEM name="DispChars">Yes</ITEM>
<ITEM name="DispFormat">2</ITEM>
<ITEM name="ShowChanges">Yes</ITEM>
<ITEM name="ShowToolTips">Yes</ITEM>
<ITEM name="TopLineAddress">00000000</ITEM>
</PROPERTIES>
</POPUP>
<POPUP w="1" x="-31995" flags="0000000a" y="-31921" h="1" pid="2" iid="2">
<PROPERTIES>
<ITEM name="DataType">2</ITEM>
<ITEM name="DispChars">Yes</ITEM>
<ITEM name="DispFormat">2</ITEM>
<ITEM name="ShowChanges">Yes</ITEM>
<ITEM name="ShowToolTips">Yes</ITEM>
<ITEM name="TopLineAddress">00000080</ITEM>
</PROPERTIES>
</POPUP>
</PWI>
</MODULE>
</WORKSPACE>

Binary file not shown.

View file

@ -1,4 +1,4 @@
BL51 BANKED LINKER/LOCATER V6.22.2.0 03/30/2022 21:37:02 PAGE 1
BL51 BANKED LINKER/LOCATER V6.22.2.0 06/04/2022 21:08:27 PAGE 1
BL51 BANKED LINKER/LOCATER V6.22.2.0, INVOKED BY:
@ -59,7 +59,7 @@ LINK MAP OF MODULE: .\Objects\MCU_1 (MAIN)
CODE 0561H 000EH UNIT ?PR?_DELAY?DELAY
CODE 056FH 0007H UNIT ?PR?LEDFULL?LED_NUM
BL51 BANKED LINKER/LOCATER V6.22.2.0 03/30/2022 21:37:02 PAGE 2
BL51 BANKED LINKER/LOCATER V6.22.2.0 06/04/2022 21:08:27 PAGE 2
@ -119,7 +119,7 @@ SYMBOL TABLE OF MODULE: .\Objects\MCU_1 (MAIN)
C:0520H LINE# 16
C:0527H LINE# 17
C:052EH LINE# 18
BL51 BANKED LINKER/LOCATER V6.22.2.0 03/30/2022 21:37:02 PAGE 3
BL51 BANKED LINKER/LOCATER V6.22.2.0 06/04/2022 21:08:27 PAGE 3
C:0533H LINE# 20
@ -179,7 +179,7 @@ SYMBOL TABLE OF MODULE: .\Objects\MCU_1 (MAIN)
C:0561H PUBLIC _delay
------- PROC _DELAY
D:0006H SYMBOL i
BL51 BANKED LINKER/LOCATER V6.22.2.0 03/30/2022 21:37:02 PAGE 4
BL51 BANKED LINKER/LOCATER V6.22.2.0 06/04/2022 21:08:27 PAGE 4
C:0561H LINE# 3
@ -239,7 +239,7 @@ SYMBOL TABLE OF MODULE: .\Objects\MCU_1 (MAIN)
C:015CH LINE# 36
C:015FH LINE# 38
C:0162H LINE# 39
BL51 BANKED LINKER/LOCATER V6.22.2.0 03/30/2022 21:37:02 PAGE 5
BL51 BANKED LINKER/LOCATER V6.22.2.0 06/04/2022 21:08:27 PAGE 5
C:016BH LINE# 40
@ -299,7 +299,7 @@ SYMBOL TABLE OF MODULE: .\Objects\MCU_1 (MAIN)
C:056FH LINE# 111
C:0572H LINE# 112
C:0575H LINE# 113
BL51 BANKED LINKER/LOCATER V6.22.2.0 03/30/2022 21:37:02 PAGE 6
BL51 BANKED LINKER/LOCATER V6.22.2.0 06/04/2022 21:08:27 PAGE 6
------- ENDPROC LEDFULL
@ -359,7 +359,7 @@ SYMBOL TABLE OF MODULE: .\Objects\MCU_1 (MAIN)
*** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS
SEGMENT: ?PR?HELLO_PUSH?LED_NUM
BL51 BANKED LINKER/LOCATER V6.22.2.0 03/30/2022 21:37:02 PAGE 7
BL51 BANKED LINKER/LOCATER V6.22.2.0 06/04/2022 21:08:27 PAGE 7
*** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

File diff suppressed because it is too large Load diff

View file

@ -269,6 +269,18 @@
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>1</GroupNumber>
<FileNumber>6</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>.\block.c</PathWithFileName>
<FilenameWithoutPath>block.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
</Group>
<Group>
@ -279,7 +291,7 @@
<RteFlg>0</RteFlg>
<File>
<GroupNumber>2</GroupNumber>
<FileNumber>6</FileNumber>
<FileNumber>7</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -291,7 +303,7 @@
</File>
<File>
<GroupNumber>2</GroupNumber>
<FileNumber>7</FileNumber>
<FileNumber>8</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -303,7 +315,7 @@
</File>
<File>
<GroupNumber>2</GroupNumber>
<FileNumber>8</FileNumber>
<FileNumber>9</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -315,7 +327,7 @@
</File>
<File>
<GroupNumber>2</GroupNumber>
<FileNumber>9</FileNumber>
<FileNumber>10</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -327,7 +339,7 @@
</File>
<File>
<GroupNumber>2</GroupNumber>
<FileNumber>10</FileNumber>
<FileNumber>11</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -337,6 +349,30 @@
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>2</GroupNumber>
<FileNumber>12</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>.\button.h</PathWithFileName>
<FilenameWithoutPath>button.h</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>2</GroupNumber>
<FileNumber>13</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>.\block.h</PathWithFileName>
<FilenameWithoutPath>block.h</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
</Group>
</ProjectOpt>

View file

@ -401,6 +401,11 @@
<FileType>1</FileType>
<FilePath>.\draw.c</FilePath>
</File>
<File>
<FileName>block.c</FileName>
<FileType>1</FileType>
<FilePath>.\block.c</FilePath>
</File>
</Files>
</Group>
<Group>
@ -431,6 +436,16 @@
<FileType>5</FileType>
<FilePath>.\draw.h</FilePath>
</File>
<File>
<FileName>button.h</FileName>
<FileType>5</FileType>
<FilePath>.\button.h</FilePath>
</File>
<File>
<FileName>block.h</FileName>
<FileType>5</FileType>
<FilePath>.\block.h</FilePath>
</File>
</Files>
</Group>
</Groups>

View file

@ -0,0 +1,19 @@
[Version]
Nu_LinkVersion=V1.1
[Process]
ProcessID=0x00000000
ProcessCreationTime_L=0x00000000
ProcessCreationTime_H=0x00000000
NuLinkID=0x00000000
[Option]
MaxClock=1
EnablePCLK=1
Erase=0
Program=1
Verify=1
ResetAndRun=1
UpdateSprom=0
IOVoltage=3300
EnableMemAcc=0
MemAccPeriod=1000
EnableLog=0

View file

@ -0,0 +1,89 @@
#include "block.h"
Group *base;
Group *piece;
void blockInit()
{
base=(Group*)calloc(1,sizeof(Group));
groupInit(*base,64);
}
void genPiece()
{
unsigned char i=2+rand()%3;
piece=(Group*)calloc(1,sizeof(Group));
groupInit(*piece,i);
}
void genShape(Group g)
{
//需要一点随机性
int random=rand()%4;
//当两个方块的情况
if(g.len==2)
{
if(random%2==0)
{
g.list[0].x=4; //
g.list[0].y=8; //
g.list[1].x=4;
g.list[1].y=9;
}
else
{
g.list[0].x=4; ////
g.list[0].y=8;
g.list[1].x=5;
g.list[1].y=8;
}
}
//当三个方块的情况
if(g.len==3)
{
if(random%2==0)
{
g.list[0].x=4; //
g.list[0].y=8; //
g.list[1].x=4; //
g.list[1].y=9;
g.list[2].x=4;
g.list[2].y=10;
}
else
{
g.list[0].x=4; //////
g.list[0].y=8;
g.list[1].x=5;
g.list[1].y=8;
g.list[2].x=4;
g.list[2].y=9;
}
}
//当四个方块的情况
if(g.len==3)
{
if(random==0)
{
g.list[0].x=4; //
g.list[0].y=8; //
g.list[1].x=4; ////
g.list[1].y=9;
g.list[2].x=4;
g.list[2].y=10;
g.list[3].x=5;
g.list[3].y=8;
}
else
{
g.list[0].x=4;
g.list[0].y=8;
g.list[1].x=5;
g.list[1].y=8;
g.list[2].x=4;
g.list[2].y=9;
}
}
}

View file

@ -0,0 +1,36 @@
#ifndef _BLOCK_H_
#define _BLOCK_H_
#include <stdlib.h>
#define MAX_X 8
#define MAX_Y 8
//点 结构体
struct _dot
{
unsigned char x;
unsigned char y;
} ;
typedef struct _dot Dot;
//块 结构体
struct _group
{
unsigned char used;//拥有的点数量
unsigned char len; //数组申请内存长度
Dot* list;
};
typedef struct _group Group;
void groupInit(Group g,unsigned char i)
{
retry:
g.len=i;
g.used=0;
g.list=(Dot*)malloc(sizeof(Dot)*g.len);
if(!g.list)
goto retry;
}
#endif

View file

@ -0,0 +1,6 @@
#ifndef _BUTTON_H_
#define _BUTTON_H_
enum OPR {left,right,confirm,idle};
#endif

View file

@ -1,17 +1,16 @@
#include <reg52.h>
#include "display.h"
#include "delay.h"
#include "img.h"
// DB P1
// CTL P3
sbit RS = P3 ^ 0;
sbit RW = P3 ^ 1;
sbit E = P3 ^ 2;
sbit CSA = P3 ^ 4;
sbit CSB = P3 ^ 5;
sbit RS = P2 ^ 0;
sbit RW = P2 ^ 1;
sbit E = P2 ^ 2;
sbit CSA = P2 ^ 4;
sbit CSB = P2 ^ 5;

View file

@ -55,7 +55,7 @@ void drawNUMBER()
P1 = 0xb8 + 2;
write();
P1 = 0X40 + j;
write(); //<EFBFBD>³2ΑΠjΖΑA
write(); //Ò³2ÁÐjÆÁB
RS = 1;
RW = 0;
@ -67,7 +67,7 @@ void drawNUMBER()
P1 = 0xb8 + 3;
write();
P1 = 0X40 + j;
write(); //<EFBFBD>³3ΑΠjΖΑA
write(); //Ò³3ÁÐjÆÁB
RS = 1;
RW = 0;
@ -111,7 +111,28 @@ void drawNAME()
RW = 0;
P1 = NAME_PAGE1[j - 1];
write();
}
}
void drawFullIMG(unsigned char img[])
{
unsigned int j,i;
for(j = 0; j < 64; j++)
for(i=0;i<8;i++)
{
CSA = 1;
CSB = 0;
RS = 0;
RW = 0;
P1 = 0xb8 + i;
write();
P1 = 0X40 + j;
write(); //Ò³iÁÐjÆÁA
RS = 1;
RW = 0;
P1 = img[j - 1];
write();
}
}

View file

@ -1,3 +1,8 @@
#ifndef _IMG_H_
#define _IMG_H_
//名字
code unsigned char NAME_PAGE0[] =
{
0x10, 0x60, 0x02, 0x0C, 0xC0, 0x04, 0x04, 0x04, 0x04, 0xFC, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00,
@ -13,31 +18,19 @@ code unsigned char NAME_PAGE1[] =
};
//学号 左
code unsigned char NUMBER_PAGE0[]={
code unsigned NUMBER_PAGE0[]={
/*-- 文字: 2 --*/
0x00,0x70,0x08,0x08,0x08,0x08,0xF0,0x00,
/*-- 文字: 0 --*/
0x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,
/*-- 文字: 2 --*/
0x00,0x70,0x08,0x08,0x08,0x08,0xF0,0x00,
/*-- 文字: 0 --*/
0x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,
/*-- 文字: 1 --*/
0x00,0x00,0x10,0x10,0xF8,0x00,0x00,0x00,
/*-- 文字: 1 --*/
0x00,0x00,0x10,0x10,0xF8,0x00,0x00,0x00,
/*-- 文字: 4 --*/
0x00,0x00,0x80,0x40,0x30,0xF8,0x00,0x00,
/*-- 文字: 4 --*/
0x00,0x00,0x80,0x40,0x30,0xF8,0x00,0x00,
};
code unsigned NUMBER_PAGE1[]={
code unsigned char NUMBER_PAGE1[]={
0x00,0x30,0x28,0x24,0x22,0x21,0x30,0x00,
0x00,0x0F,0x10,0x20,0x20,0x10,0x0F,0x00,
0x00,0x30,0x28,0x24,0x22,0x21,0x30,0x00,
@ -46,21 +39,85 @@ code unsigned NUMBER_PAGE1[]={
0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,
0x00,0x06,0x05,0x24,0x24,0x3F,0x24,0x24,
0x00,0x06,0x05,0x24,0x24,0x3F,0x24,0x24,
};
code unsigned NUMBER_RPAGE0[]=
//学号 右
code unsigned char NUMBER_RPAGE0[]=
{
0x00,0xF0,0x08,0x08,0x08,0x10,0xE0,0x00,
0x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,
};
code unsigned NUMBER_RPAGE1[]=
code unsigned char NUMBER_RPAGE1[]=
{
0x00,0x01,0x12,0x22,0x22,0x11,0x0F,0x00,
0x00,0x0F,0x10,0x20,0x20,0x10,0x0F,0x00,
};
code unsigned char MAIN_MENU={
0x00,0x00,0x00,0x00,0x20,0xA0,0xA0,0xA0,0xF0,0xA0,0xA0,0xF0,0xA0,0xA0,0xE0,0x20,
0x00,0x00,0x00,0xC0,0x40,0x50,0x60,0xC0,0x40,0x60,0x50,0x40,0xC0,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,0x48,0x48,0x2B,0x1C,0x08,0xFD,0x0A,0x18,0x2C,0x4A,0x49,0x40,
0x00,0x10,0x10,0x17,0x15,0x15,0x15,0xFF,0x15,0x15,0x15,0x15,0x17,0x10,0x10,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,0x30,0x20,0x00,0xE0,0x40,0x40,
0xF0,0x40,0x40,0x40,0x00,0x00,0x00,0x20,0x20,0xE0,0x20,0x20,0xA0,0xA0,0xE0,0xA0,
0xA0,0xA0,0x20,0x00,0x00,0x00,0x00,0x10,0xF0,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,0x81,0x41,0x7F,0x41,0xA1,0x91,0x8F,
0x81,0xBF,0xA1,0xA1,0x91,0x80,0x00,0x20,0x20,0x1F,0x10,0x90,0xBF,0x40,0x30,0x2E,
0x20,0x5F,0x80,0x00,0x00,0x00,0x00,0x00,0x3F,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,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,0x30,0x20,0x00,0xE0,0x40,0x40,
0xF0,0x40,0x40,0x40,0x00,0x00,0x00,0x20,0x20,0xE0,0x20,0x20,0xA0,0xA0,0xE0,0xA0,
0xA0,0xA0,0x20,0x00,0x00,0x40,0x30,0x10,0x10,0x30,0xE0,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,0x81,0x41,0x7F,0x41,0xA1,0x91,0x8F,
0x81,0xBF,0xA1,0xA1,0x91,0x80,0x00,0x20,0x20,0x1F,0x10,0x90,0xBF,0x40,0x30,0x2E,
0x20,0x5F,0x80,0x00,0x00,0x20,0x30,0x28,0x24,0x23,0x21,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,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,}
//void writeData(unsigned char d)
//{
// RS = 1;
@ -89,3 +146,5 @@ code unsigned NUMBER_RPAGE1[]=
//{
// setCommand(0x40 + p);
//}
#endif

View file

@ -3,24 +3,25 @@
#include "display.h"
#include "menu.h"
#include "draw.h"
#include "button.h"
extern Menu *NOW;
enum OPR opr=idle;
sbit RS = P2 ^ 0;
sbit RW = P2 ^ 1;
sbit E = P2 ^ 2;
sbit CSA = P2 ^ 4;
sbit CSB = P2 ^ 5;
sbit RS = P3 ^ 0;
sbit RW = P3 ^ 1;
sbit E = P3 ^ 2;
sbit CSA = P3 ^ 4;
sbit CSB = P3 ^ 5;
sbit LCDRST =P2^3;
int main()
{
menuInit();
NOW->f(NOW);
while(1)
{
NOW->f(NOW,opr);
}
}

View file

@ -3,19 +3,20 @@
#include "delay.h"
#include "draw.h"
Menu M_MAINMANU;
Menu M_MAINMANU;//寮꽉데
Menu M_PLAYMODE1; //띤쭈薑렘욥
Menu* NOW; //现在菜单指针
Menu* NOW; //뎠품꽉데寧濾
//놓迦꽉데
void m_startup(struct _menu* this)
void m_startup(struct _menu* this,enum OPR opr)
{
displayInit();
clear();
@ -23,7 +24,7 @@ void m_startup(struct _menu* this)
delay(1000);
drawNUMBER();
delay(3000);
clear();
// clear();
NOW=this->n;
}
Menu M_STARTUP={&M_MAINMANU,m_startup};

View file

@ -1,7 +1,13 @@
#ifndef _MENU_H_
#define _MENU_H_
#include "button.h"
typedef struct _menu
{
struct _menu* n;
void(*f)(struct _menu* this);
void(*f)(struct _menu* this, enum OPR opr);
}Menu;
void menuInit();
#endif