导航:首页 > 操作系统 > 单片机开发游戏

单片机开发游戏

发布时间:2023-08-13 16:01:12

㈠ 我打算用单片机和一块12864屏幕做一个简单的游戏机 在屏幕显示的方面要掌握哪些知识呢

12864液晶是单色的,一点占一位数据,你按照所选12864的手册写点就ok了,我做了一个带字库的图像显示程序,可以实现一幅图片的上下左右移动,你可以参考试试。
#include<reg51.h>
#include <math.h>
#include "stdio.h"
void send_com(unsigned char cmd);
void send_data(unsigned char dat);
void print(unsigned char x,unsigned char y,char* str);
#define DATA P0 //P2接数据口
#define uint unsigned int
#define uchar unsigned char

sfr WATCH_DOG=0xc1;
sfr P4=0xc0;
sfr P4SW=0xbb;
sbit RS=P3^7;
sbit RW=P3^6;
sbit P21=P2^1;
sbit P20=P2^0;
sbit E=P4^5;
sbit SPISS=P4^0;
uchar gun[16];
uchar xdata pictotal[1024];
uchar code LCD_picture1[]=
{
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0x3F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0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,0x00,0x00,0x00,0x07,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xFF,0xFF,0xFF
};
void delay(uint i)
{
char a;
while(i--)
{
for(a=0;a<10;a++);
}
}
void delay1(uint i)
{
while(i--);
}
//测忙碌子程序
//RS=0,RW=1,E=H,D0-D7=状态字
void chek_busy(void)
{ unsigned char temp1;//状态信息(判断是否忙)
P2=0x13;
P20=0;
P21=1;
DATA=0xFF;
RS = 0;
delay1(10);
RW = 1;
delay1(10);
do{
E = 1;
P21=0;
delay1(10);
temp1 = DATA;
E = 0;
delay1(10);
} while(temp1&0x80);//??????
RS = 0;
delay1(10);
RW = 0;
P20=1;
delay1(10);
P2=0x13;
}
/*************读数据************/
read_12864()
{
uchar shuju;
P20=0;
P21=1;
DATA=0xff;
RS=1;
delay1(10);
RW=1;
delay1(10);
E=1;
P21=0;
delay1(10);
shuju=DATA;
E=0;
delay1(10);
P2=0x13;
return(shuju);
}
//写命令子程序
void send_com(unsigned char cmd)/*写命令*/
{
chek_busy();
P2=0x13;
delay1(10);
P20=0;
RS = 0;
delay1(10);
RW = 0;
delay1(10);
P21=1;
E = 1;
delay1(10);
DATA = cmd;
E = 0;
P20=1;
delay1(10);
P2=0x13;
}

//写数据子程序
void send_data(unsigned char dat)
{
chek_busy();
P2=0x13;
P20=0;
RS = 1;
delay1(10);
RW = 0;
delay1(10);
P21=1;
E = 1;
delay1(10);
DATA = dat;
E = 0;
P20=1;
delay1(10);
P2=0x13;
}

// 设置字符串显示位置 xpos(0~7),ypos(1~4)
void set_xy(unsigned char xpos,unsigned char ypos)
{
switch(ypos)
{
case 1:
send_com(0x80|xpos);break;
case 2:
send_com(0x90|xpos);break;
case 3:
send_com(0x88|xpos);break;
case 4:
send_com(0x98|xpos);break;
default:break;
}
}

// 在指定位置显示字符串
void print(unsigned char x,unsigned char y,char* str)
{
unsigned char lcd_temp;
set_xy(x,y);
lcd_temp=*str;
while(lcd_temp != 0x00)
{
send_data(lcd_temp);
lcd_temp=*(++str);
}
}

// 显示图片
void disppicture(uchar code *adder)
{
uint i,j;
for(i=0;i<32;i++)
{
send_com(0x80 + i);
send_com(0x80);
for(j=0;j<16;j++)
{
send_data(~*adder);
adder++;
}
}

for(i=0;i<32;i++)
{
send_com(0x80 + i);
send_com(0x88);
for(j=0;j<16;j++)
{
send_data(~*adder);
adder++;
}
}
}
// 反白函数
void con_disp(uchar data1,uchar data2,uchar x0,uchar y0,uchar xl,uchar yl)
//dara1 data2为0x00或0xff,x0为横起始坐标(0~7),y0为纵起始坐标(0~63),x1为长度(1~8),y1为宽度(1~64)。
{
uchar i,j,k;
if(y0<32)
{
for(j=0;j<yl;j++)
{
for(i=0;i<xl;i++)
{
send_com(0x34);// 扩展功能
send_com(0x80+y0+j);// 写Y坐标
send_com(0x80+x0+i);// 写X坐标
send_com(0x30);// 普通功能
send_data(data1);
send_data(data2);
}
}
if((y0+yl)>32)
{
k=y0+yl-32;
yl=k;
y0=0;
for(j=0;j<yl;j++)
{
for(i=0;i<xl;i++)
{
send_com(0x34);// 扩展功能
send_com(0x80+y0+j);// 写Y坐标
send_com(0x88+x0+i);// 写X坐标
send_com(0x30);// 普通功能
send_data(data1);
send_data(data2);
}
}
}
}
else
{
for(j=0;j<yl;j++)
{
for(i=0;i<xl;i++)
{
send_com(0x34);// 扩展功能
send_com(0x80+y0-32+j);// 写Y坐标
send_com(0x88+x0+i);// 写X坐标
send_com(0x30);// 普通功能
send_data(data1);
send_data(data2);
}
}
}
send_com(0x36);// 开绘图显示
}
// 画任意点
void dian( unsigned char X, unsigned char Y, unsigned char Color )
{
unsigned char Row , Tier , Tier_bit ;
unsigned char ReadOldH, ReadOldL ;
send_com( 0x34 ) ;
send_com( 0x36 ) ;
Tier = X >> 4 ;
Tier_bit = X & 0x0f ;
if( Y < 32 )
{
Row = Y ;
}
else
{
Row = Y - 32 ;
Tier += 8 ;
}
send_com( Row + 0x80 ) ;
send_com( Tier + 0x80 ) ;
read_12864() ;
ReadOldH = read_12864() ;
ReadOldL = read_12864() ;
send_com( Row + 0x80 ) ;
send_com( Tier + 0x80 ) ;
if( Tier_bit < 8 )
{
switch( Color)
{
case 0 : ReadOldH &=( ~( 0x01 << ( 7 - Tier_bit ))) ; break ;
case 1 : ReadOldH |= ( 0x01 << ( 7 - Tier_bit )) ; break ;
case 2 : ReadOldH ^= ( 0x01 << ( 7 - Tier_bit )) ; break ;
default : break ;
}
send_data( ReadOldH ) ;
send_data( ReadOldL ) ;
}
else
{
switch(Color)
{
case 0 : ReadOldL &= (~( 0x01 << ( 15 - Tier_bit ))) ; break ;
case 1 : ReadOldL |= ( 0x01 << ( 15 - Tier_bit )) ; break ;
case 2 : ReadOldL ^= ( 0x01 << ( 15 - Tier_bit )) ; break ;
default : break ;
}
send_data( ReadOldH ) ;
send_data( ReadOldL ) ;
}
send_com( 0x30 );
}

//画水平线
void linex( unsigned char X0, unsigned char X1, unsigned char Y, unsigned char Color )
{ unsigned char Temp ;
if( X0 > X1 )
{
Temp = X1 ;
X1 = X0 ;
X0 = Temp ;
}
for( ; X0 <= X1 ; X0++ )
dian( X0, Y, Color ) ;
}

//画垂直线
void liney( unsigned char X, unsigned char Y0, unsigned char Y1, unsigned char Color )
{
unsigned char Temp ;
if( Y0 > Y1 )
{
Temp = Y1 ;
Y1 = Y0 ;
Y0 = Temp ;
}
for(; Y0 <= Y1 ; Y0++)
dian( X, Y0, Color) ;
}
//画任意两点间线段
void line( unsigned char StartX, unsigned char StartY, unsigned char EndX, unsigned char EndY, unsigned char Color )
{
int t, distance;
int x = 0 , y = 0 , delta_x, delta_y ;
char incx, incy ;
delta_x = EndX - StartX ;
delta_y = EndY - StartY ;
if( delta_x > 0 )
{
incx = 1;
}
else if( delta_x == 0 )
{
liney( StartX, StartY, EndY, Color ) ;
return ;
}
else
{
incx = -1 ;
}
if( delta_y > 0 )
{
incy = 1 ;
}
else if(delta_y == 0 )
{
linex( StartX, EndX, StartY, Color ) ;
return ;
}
else
{
incy = -1 ;
}
delta_x = abs( delta_x );
delta_y = abs( delta_y );
if( delta_x > delta_y )
{
distance = delta_x ;
}
else
{
distance = delta_y ;
}
dian( StartX, StartY, Color ) ;

for( t = 0 ; t <= distance+1 ; t++ )
{
dian( StartX, StartY, Color ) ;
x += delta_x ;
y += delta_y ;
if( x > distance )
{
x -= distance ;
StartX += incx ;
}
if( y > distance )
{
y -= distance ;
StartY += incy ;
}
}
}

void readpic()
{
uchar i,j;
uint k;
k=0;
send_com( 0x34 );
send_com( 0x36 );
for(i=0;i<32;i++){
for(j=0;j<8;j++){
send_com( i + 0x80 ) ;
send_com( j + 0x80 ) ;
read_12864() ;
pictotal[k] = read_12864() ;
pictotal[k+1] = read_12864() ;
k+=2;
}
}
for(i=0;i<32;i++){
for(j=0;j<8;j++){
send_com( i + 0x80 ) ;
send_com( j + 0x88 ) ;
read_12864() ;
pictotal[k] = read_12864() ;
pictotal[k+1] = read_12864() ;
k+=2;
}
}
}
//LCD字库初始化函数
void lcd_str(void)
{
delay(4000);
send_com(0x30);
delay(1000);
send_com(0x0C);
delay(1000);
send_com(0x01);
delay(1000);
send_com(0x06);
}
//LCD图片(扩展)初始化函数
void lcd_pic(void)
{
send_com(0x36);
delay(1000);
send_com(0x36);
delay(1000);
send_com(0x3E);
delay(1000);
send_com(0x01);
}
//——————清整个GDRAM空间—————————-
void clr_pic()
{
unsigned char x,y ;
for(y=0;y<64;y++)
for(x=0;x<16;x++)
{
send_com(0x34);
send_com(y+0x80);
send_com(x+0x80);
send_com(0x30);
send_data(0x00);
send_data(0x00);
}
}
void drawx(uchar y)
{
if(y<32){
send_com(0x80 + y);
send_com(0x80);
}
if(y>=32){
send_com(0x80 + y - 32);
send_com(0x88);
}
}
//左滚动一行
void rotl16()
{
uchar i,ch0,ch1,ch;
ch0=gun[0];
ch=(ch0&0x80)>>7;

for(i=0;i<15;i++){
gun[i]=gun[i]<<1;
gun[i]=gun[i]|((gun[i+1]&0x80)>>7);
}
gun[15]=(gun[15]<<1)|ch;

}
//右滚动一行
void rotr16()
{
uchar i,ch0,ch1,ch;
ch0=gun[15];
ch=(ch0&0x01)<<7;

for(i=15;i>0;i--){
gun[i]=gun[i]>>1;
gun[i]=gun[i]|((gun[i-1]&0x01)<<7);
}
gun[0]=(gun[0]>>1)|ch;

}
/**************主函数****************************/
void main()
{
uchar x,y,i,n;
uint k;
P4SW=0x70;
lcd_pic();
disppicture(LCD_picture1);
readpic();
lcd_pic();
while(1)
{

for(i=0;i<64;i++){ //下滚动
k=0;
for(x=i;x<64;x++){
drawx(x);
for(y=0;y<16;y++)
{
gun[y]=pictotal[k];
k++;
send_data(gun[y]);
}
}
for(x=0;x<i;x++){
drawx(x);
for(y=0;y<16;y++)
{
gun[y]=pictotal[k];
k++;
send_data(gun[y]);
}
}
}
lcd_pic();

for(i=63;i>0;i--){ //上滚动
k=0;
for(x=i;x<64;x++){
drawx(x);
for(y=0;y<16;y++)
{
gun[y]=pictotal[k];
k++;
send_data(gun[y]);
}
}
for(x=0;x<i;x++){
drawx(x);
for(y=0;y<16;y++)
{
gun[y]=pictotal[k];
k++;
send_data(gun[y]);
}
}
}

for(i=0;i<128;i++){ //左滚动
k=0;
for(x=0;x<64;x++){
drawx(x);
for(y=0;y<16;y++)
{
gun[y]=pictotal[k];
k++;
}
rotl16();
k-=16;
for(y=0;y<16;y++)
{
pictotal[k]=gun[y];
send_data(gun[y]);
k++;
}
}
}
for(i=0;i<128;i++){ //右滚动
k=0;
for(x=0;x<64;x++){
drawx(x);
for(y=0;y<16;y++)
{
gun[y]=pictotal[k];
k++;
}
rotr16();
k-=16;
for(y=0;y<16;y++)
{
pictotal[k]=gun[y];
send_data(gun[y]);
k++;
}
}
}

}}

㈡ 单片机也能玩游戏,你hold住了吗

最多也就是俄罗斯方块,贪吃蛇,没有比遥控车飞机好玩。

㈢ 用51单片机做个贪吃蛇游戏。

单片机,晶振,液晶屏,按键,电阻,电容,电源及pcb板等,认为必要的话,还可准备一些发光二极管作指示灯。也可采购一套开发板套件,大部分开发板套件都有上述器件。

㈣ 单片机俄罗斯方块游戏设计申请理由

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

然后通过Protues仿真实现通过外部按键来控制各种不同图形的方块来玩游戏,并且实现记录分数和通过过关数来改变方块下降的速度。最后将程序下载至AT89S52单片机并进行实际运行,实际运行表明,本设计可以实现基本的游戏功能.达到预期的目的。

㈤ 想用单片机做一个掌上游戏机,都需要什么外围芯片和设备,用c语言编程行吗

既然是游戏机就需要显示屏和按键,单片机如果不够快的话要用专门的芯片处理显示屏和按键,够快就不需要额外芯片了。C语言可以啊,LINUX都是用C写出来的,不用担心。

㈥ 51单片机怎么做做游戏机

要用51单片机做做游戏机,只能做些简单的游戏机,例如,用8X8点阵模块做个贪吃蛇,用12864点阵屏做个更好些的贪吃蛇,俄罗斯方块等。像手机上玩的游戏就做不了的,速度不够,手机用的显示屏又不好驱动。

阅读全文

与单片机开发游戏相关的资料

热点内容
如何关闭手机dhcp服务器 浏览:979
php免费ide 浏览:200
程序员词句 浏览:976
服务器如何禁止某个ip段 浏览:329
便签手机文件夹 浏览:768
gameloft的java游戏 浏览:110
神佑释放怎么转服务器 浏览:735
洋葱app软件怎么登录 浏览:788
两相电空气压缩机 浏览:396
基于51单片机的智能语音密码锁设计 浏览:845
mac如何用ssh登录服务器 浏览:446
appstore怎么设置 浏览:954
在哪个app买韩国女装 浏览:111
php写入文件换行 浏览:749
dsp实现fft算法 浏览:485
棋牌源码转让交易手续费 浏览:293
云上服务器贵州 浏览:647
qq三国怎么使用云服务器 浏览:303
一键加密字体怎么设置 浏览:145
majority算法 浏览:822