📄 box.lst
字号:
C51 COMPILER V7.06 BOX 09/02/2008 17:59:01 PAGE 1
C51 COMPILER V7.06, COMPILATION OF MODULE BOX
OBJECT MODULE PLACED IN box.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE box.c BROWSE DEBUG OBJECTEXTEND
stmt level source
1 /**********************************************************************
2 1.方块图标坐标举例:
3 7高位4 3低位0
4 ┌─────────┐
5 │□□□□ ○■□□│
6 │□□□□ ■■■□│
7 │□□□□ □□□□│
8 │□□□□ □□□□│
9 └─────────┘
10 对于上幅方块图像,,,○所示处为(0,0)点,,,
11 2.RAM坐标举例 31X40(x,y):
12 |┌──────────────┐|
13 |│(0, 1) (0,1) ... (0, 40) │|
14 |│(1, 1) │|
15 |│ . │|
16 |│ . │|
17 |│ . │|
18 |│(30,1) ... (30,40) │|
19 |└──────────────┘|
20 |________________________________|
21 第0列第41列第31行为游戏的边界线
22 */
23
24 //line:31 colum:5*8
25 unsigned char idata tidu[31][5]={
26 0x01,0x00,0x00,0x00,0x00,
27 0x02,0x00,0x00,0x00,0x00,
28 0x04,0x00,0x00,0x00,0x00,
29 0x08,0x00,0x00,0x00,0x00,
30 0xff,0xff,0xff,0xff,0xff,
31 0xff,0xff,0xff,0xff,0xff,
32 0xff,0xff,0xff,0xff,0xff,
33 0xff,0xff,0xff,0xff,0xff,
34 0xff,0xff,0xff,0xff,0xff,
35 0xff,0xff,0xff,0xff,0xff,
36 0xff,0xff,0xff,0xff,0xff,
37 0xff,0xff,0xff,0xff,0xff,
38 0xff,0xff,0xff,0xff,0xff,
39 0xff,0xff,0xff,0xff,0xff,
40 0xff,0xff,0xff,0xff,0xff,
41 0xff,0xff,0xff,0xff,0xff,
42 0xff,0xff,0xff,0xff,0xff,
43 0xff,0xff,0xff,0xff,0xff,
44 0xff,0xff,0xff,0xff,0xff,
45 0xff,0xff,0xff,0xff,0xff,
46 0xff,0xff,0xff,0xff,0xff,
47 0xff,0xff,0xff,0xff,0xff,
48 0xff,0xff,0xff,0xff,0xff,
49 0xff,0xff,0xff,0xff,0xff,
50 0xff,0xff,0xff,0xff,0xff,
51 0xff,0xff,0xff,0xff,0xff,
52 0xff,0xff,0xff,0xff,0xff,
53 0xff,0xff,0xff,0xff,0xff,
54 0xff,0xff,0xff,0xff,0xff,
55 0x02,0x00,0x00,0x00,0x00,
C51 COMPILER V7.06 BOX 09/02/2008 17:59:01 PAGE 2
56 0x01,0x00,0x00,0x00,0x00,
57 };
58 3.
*** ERROR C141 IN LINE 58 OF BOX.C: syntax error near '3.'
59 (x,y)x:line.y:colum
*** ERROR C141 IN LINE 59 OF BOX.C: syntax error near ',', expected ')'
*** ERROR C129 IN LINE 59 OF BOX.C: missing ';' before ')'
60 (0,0) ||(0,1)----------------------------(0,40)|| (0,41)
61 (1,0) ||(1,1)----------------------------(1,40)|| (1,41)
62 (2,0) ||(2,1)----------------------------(2,40)|| (2,41)
63 ----- ||---------------------------------------||-----
64 (30,0)||(30,1)--------------------------(30,40)|| (30,41)
65 ______________________________________________________
66 --------------------------------------------------------
67 (31,0)||(31,1)--------------------------(31,40)||(31,41)
68 外面为游戏边界区:第0列,第41列,第31行
69 里面为游戏区:第0列,第41列,第31行之间的区域
70
71 4 http://blog.ednchina.com/zook0k/
72 ***********************************************************************/
73
74 /**********************************************************************
75 * 功能: 方块的图形代码,,每四个字节表示一个图形
76 * 每行表示一个内容,,只表示了第一个状态的样子
77 * 其它按顺时针转图形可得
78 ***********************************************************************/
79 unsigned char code TtrsBlck[]={ //
80 /* ■
81 ■■■ Middle 0 0
82 */
83 0x04,0x0E,0x00,0x00,0x08,0x0C,0x08,0x00,0x0E,0x04,0x00,0x00,0x04,0x0C,0x04,0x00,
84 /*■
85 ■■■ Left 16 1
86 */
87 0x08,0x0E,0x00,0x00,0x0C,0x08,0x08,0x00,0x0E,0x02,0x00,0x00,0x04,0x04,0x0C,0x00,
88 /*■■■
89 ■ Right 32 2
90 */
91 0x02,0x0E,0x00,0x00,0x08,0x08,0x0C,0x00,0x0E,0x08,0x00,0x00,0x0C,0x04,0x04,0x00,
92 /*■■
93 ■■ Z 48 3
94 */
95 0x0C,0x06,0x00,0x00,0x04,0x0C,0x08,0x00,
96 /* ■■
97 ■■ Z_Reversal 56 4
98 */
99 0x06,0x0C,0x00,0x00,0x08,0x0C,0x04,0x00,
100
101
102 /*■■■■ Line 64 5
103 */
104 0x0F,0x00,0x00,0x00,0x08,0x08,0x08,0x08,
105
106 /*■■
107 ■■ Stone 72 6
108 */
109 0x0C,0x0C,0x00,0x00
110 };
111
112 /********************************************************************
113 * 功能: 图形指针数组
114 * 指示了各种方块在图形代码里的最初指针
C51 COMPILER V7.06 BOX 09/02/2008 17:59:01 PAGE 3
115 ***********************************************************************/
116 char code TtrsBlckPoint[ ]={ 0, //Middle
117 16, //Left
118 32, //Right
119 48, //Z
120 56, //Z-twist
121 64, //Line
122 72 //Stone
123 };
124
125 /********************************************************************
126 * 名称: INT8U code TtrsBlckStsNum[]
127 * 功能: 方块状态个数
128 * 表示每种方块的状态的个数
129 ***********************************************************************/
130 char code TtrsBlckStsNum[ ]={ 4, //Middle
131 4, //Left
132 4, //Right
133 2, //Z
134 2, //Z-twist
135 2, //Line
136 1 //Stone
137 };
138 typedef struct
139 {
140 unsigned char BlckIndex :4; //对象序号0~6
141 unsigned char Status :4; //每个对象当前形状0~3
142 unsigned char code * pPIC; //对应于图形区的指针
143 unsigned char x,y; //位置
144 }TETRIS;
145
146 TETRIS this;
147
148 char code fig[10][17]={ {0x00,0x0F,0x10,0x20,0x20,0x10,0x0F,0x00,0x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00},
-//0
149 {0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,0x00,0x10,0x10,0xF8,0x00,0x00,0x00,0x00},
150 {0x00,0x30,0x28,0x24,0x22,0x21,0x30,0x00,0x00,0x70,0x08,0x08,0x08,0x88,0x70,0x00},
151 {0x00,0x18,0x20,0x20,0x20,0x11,0x0E,0x00,0x00,0x30,0x08,0x88,0x88,0x48,0x30,0x00},
152 {0x00,0x07,0x04,0x24,0x24,0x3F,0x24,0x00,0x00,0x00,0xC0,0x20,0x10,0xF8,0x00,0x00},
153 {0x00,0x19,0x21,0x20,0x20,0x11,0x0E,0x00,0x00,0xF8,0x08,0x88,0x88,0x08,0x08,0x00},
154 {0x00,0x0F,0x11,0x20,0x20,0x11,0x0E,0x00,0x00,0xE0,0x10,0x88,0x88,0x18,0x00,0x00},
155 {0x00,0x00,0x00,0x3F,0x00,0x00,0x00,0x00,0x00,0x38,0x08,0x08,0xC8,0x38,0x08,0x00},
156 {0x00,0x1C,0x22,0x21,0x21,0x22,0x1C,0x00,0x00,0x70,0x88,0x08,0x08,0x88,0x70,0x00},
157 {0x00,0x00,0x31,0x22,0x22,0x11,0x0F,0x00,0x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00}};//9
158
159
160 void Box_Generate(void);
161 void Write_Box_ditu(void);
162
163 /*
164
165
166 初始化
167 while(1)
168 {
169 生成一个方块,如失败结束
170 while(1)
171 {
172 检测按键并移动方块
173 如果方块不能移动则
174 判断有无重复行并消除程序跳出循环
175 }
C51 COMPILER V7.06 BOX 09/02/2008 17:59:01 PAGE 4
176 }
177 */
C51 COMPILATION COMPLETE. 0 WARNING(S), 3 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -