基于单片机实现的俄罗斯方块游戏

 

MCU based Russia block game

摘  要

本设计是通过AT89S52单片机来实现俄罗斯方块游戏的设计,使用C语言进行编程,并通过Proteus来进行仿真。

本设计要实现的基本功能是:应用按键来控制方块的变换与移动;消除一行并计分;消除多行额外奖励记分,方块堆满时结束游戏等俄罗斯方块的基本功能。单片机在手持娱乐设备上的应用具有非常大的潜力,它能将其带入到一个新的阶段。为了解决外部电路图,必须充分了解所用液晶的显示方法和单片机的外部接口功能,和所需要处理的逻辑关系;还要理解LCD液晶的控制原理,来通过数据端口和控制端口来实现画面在液晶上面的显示。

程序则要求对外部电路了解的情况下完成自己所需要的功能,并将所要完成的功能用编程语言的形式来实现。然后通过Protues仿真实现通过外部按键来控制各种不同图形的方块来玩游戏,并且实现记录分数和通过过关数来改变方块下降的速度。最后将程序下载至AT89S52单片机并进行实际运行,实际运行表明,本设计可以实现基本的游戏功能,达到预期的目的。

 

关键词AT89S52;C语言;Proteus仿真;LCD液晶

 

ABSTRACT

This design is achieved through the AT89S52 microcontroller Tetris game design, programming using C language, and carried out by proteus simulation.

The design to achieve the basic functions are: application buttons to control the box, change and movement; eliminate line and scoring; eliminate multi-line incentive points, the game ends when the box filled with basic functions such as Tetris. MCU in the application of handheld entertainment devices have great potential, it can be brought to a new stage. In order to solve the external circuit, we must fully understand the liquid crystal display method and external interface MCU features, and the need to address the logical relationship; also understand that the principle of LCD liquid crystal control to a data port and control port to achieve the above the LCD screen display.

Program requires knowledge of the external circuit where they need to complete the function and the function to be completed in the form of programming language used to achieve. Simulation then protues buttons to control an external box to play a variety of graphical games, and achieve record number of scores and the relationship had to change the speed of the module down. Finally, the program downloaded to AT89S52 MCU and the actual operation, the actual operation indicate that this design can achieve basic game functions, to achieve the desired purpose.

 

Key WordsAT89S52; C language; Proteus simulation; LCD liquid cryst

 

目    录

 

 

1…. 绪  论… 1

1.1      课题背景… 1

1.2      电子游戏及其分类… 1

1.3      电子游戏发展现状… 2

1.3.1      电子游戏国外发展现状… 2

1.3.2      电子游戏国内发展现状… 3

2…. 整体设计方案… 5

2.1      系统的核心部分单片机… 5

2.1.1      单片机的选择… 5

2.1.2      AT89S52引脚功能描述… 7

2.1.3      晶振特性… 9

2.2      液晶显示模块… 10

2.2.1      液晶显示控制驱动器HD61202的特点… 10

2.2.2      液晶显示控制驱动器HD61202的引脚功能… 10

2.2.3      液晶显示控制驱动器HD61202的指令系统… 11

2.2.4      HD61202的软件设计… 12

2.2.5      JM12864J的电路结构特点… 15

2.2.6      JM12864J的应用… 16

2.2.7      键盘电路… 17

3…. 系统程序的设计… 18

3.1      俄罗斯方块驱动流程图… 18

3.2      俄罗斯方块所有绘图工作流程图… 19

3.3      俄罗斯方块中按下键的流程图… 20

3.4      俄罗斯方块所有绘图工作流程图… 21

4…. 系统仿真… 22

4.1      PROTUES软件介绍… 22

4.2      Keil软件介绍… 22

4.3      俄罗斯方块系统PROTUES仿真… 24

5…. 实物的制作与调试… 26

5.1      电路的焊接… 26

5.2      系统性能测试与功能说明… 27

结  论… 28

参考文献… 29

附录1:C语言程序… 30

附录2:电路原理图… 59

附录3:英文资料及中文翻译… 60

致  谢… 76

 

 

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

本站所有资源版权均属于原作者所有,这里所提供资源均只能用于参考学习用,请勿直接商用。若由于商用引起版权纠纷,一切责任均由使用者承担。更多说明请参考 VIP介绍。

最常见的情况是下载不完整: 可对比下载完压缩包的与网盘上的容量,若小于网盘提示的容量则是这个原因。这是浏览器下载的bug,建议用百度网盘软件或迅雷下载。 若排除这种情况,可在对应资源底部留言,或联络我们。

对于会员专享、整站源码、程序插件、网站模板、网页模版等类型的素材,文章内用于介绍的图片通常并不包含在对应可供下载素材包内。这些相关商业图片需另外购买,且本站不负责(也没有办法)找到出处。 同样地一些字体文件也是这种情况,但部分素材会在素材包内有一份字体下载链接清单。

如果您已经成功付款但是网站没有弹出成功提示,请联系站长提供付款信息为您处理

源码素材属于虚拟商品,具有可复制性,可传播性,一旦授予,不接受任何形式的退款、换货要求。请您在购买获取之前确认好 是您所需要的资源