快速业务通道

?ú?÷è?′ó??ó??·′ú??????

作者 佚名技术 来源 程序设计 浏览 发布时间 2012-06-29

#include "graphics.h"
?????? #include "bios.h"
?????? #include "conio.h"
?????? #include "stdlib.h"
?????? #include "dos.h"

?????? #define UP 0x4800
?????? #define DOWN 0x5000
?????? #define LEFT 0x4600
?????? #define RIGHT 0x4d00
?????? #define ESC 0x0016

?????? #define VGA256 0x13
?????? #define TEXT 0x03

?????? int x,y,l,sxzy=0,zx=0,xx=5,yy=167;
?????? int x1=5,y1=3,x3=0,y3=0,x4=0,y4=0;
?????? int youlife=50,mylife=30;
?????? int board[100][170];

?????? unsigned char far *video_buff=(char far *)0xA0000000L;

?????? void setvideomode(int mode)
?????? { union REGS inregs,outregs;
?????????? inregs.h.ah=0;
?????????? inregs.h.al=(unsigned char)mode;
?????????? int86(0x10,&inregs,&outregs);
?????? }

?????? void v_line(int y0,int y1,int x,unsigned int color)
?????? { unsigned int address,n,temp;
?????????? address=320*y0+x;
?????????? for(n=0;n<=y1-y0;n++)
?????????????? {
?????????????????? if(y0>y1)
?????????????????????? {
?????????????????????????? temp=y1;
?????????????????????????? y1=y0;
?????????????????????????? y0=temp;
?????????????????????? }
?????????????????? video_buff[address]=color;
?????????????????? address+=320;
?????????????? }
?????? }

?????? void h_line(int x0,int x1,int y,unsigned int color)
?????? { unsigned int address,n,temp;
?????????? address=320*y+x0;
?????????? for(n=0;n<=x1-x0;n++)
?????????????? {
?????????????????? if(x0>x1)
?????????????????????? {
?????????????????????????? temp=x1;
?????????????????????????? x1=x0;
?????????????????????????? x0=temp;
?????????????????????? }
?????????????????? video_buff[address]=color;
?????????????????? address+=1;
?????????????? }
?????? }

void p_pixel(int x,int y,unsigned int color)
?????? { video_buff[y*320+x]=color;
?????? }

?????? void s_square(int x,int y,int side,int color)
?????? {
?????????? h_line(x,x+side,y,color);
?????????? h_line(x,x+side,y+side,color);
?????????? v_line(y,y+side,x,color);
?????????? v_line(y,y+side,x+side,color);
?????? }

?????? void r_rectangle(int x1,int y1,int x2,int y2,int color)
?????? {
?????????? h_line(x1,x2,y1,color);
?????????? h_line(x1,x2,y2,color);
?????????? v_line(y1,y2,x1,color);
?????????? v_line(y1,y2,x2,color);

?????? }

?????? void fillRectangle(int x1,int y1,int x2,int y2,int color)
?????? {
???????? int i;
???????? for(i=y1;i<=y2;i++)
???????? {
???????????? h_line(x1,x2,i,color);
???????? }
?????? }


?????? void ground()??/*?-ía?ò*/
?????? { r_rectangle(104,20,207,190,7);
?????? }

?????? void delzx()??/*??′?3?è-oó£?é?3yè-í·*/
?????? { delay(1000);
?????????? s_square(x3,y3,5,0);
?????????? s_square(x3,y3-6,5,0);
?????????? x3=0;
?????????? y3=0;
?????? }

?????? void me()??/*?-3?×??o*/
?????? { int cas=0;
?????????? if(sxzy==18432)??/*è?1?°′é??ü£??ííùé?ò??ˉ*/
?????????????? { yy-=5;
?????????????????? if(yy < y1+30)
?????????????????????? yy+=5;
?????????????????? if(yy==12)
?????????????????????? yy=17;
?????????

凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!

分享到: 更多

Copyright ©1999-2011 厦门凌众科技有限公司 厦门优通互联科技开发有限公司 All rights reserved

地址(ADD):厦门软件园二期望海路63号701E(东南融通旁) 邮编(ZIP):361008

电话:0592-5908028 传真:0592-5908039 咨询信箱:web@lingzhong.cn 咨询OICQ:173723134

《中华人民共和国增值电信业务经营许可证》闽B2-20100024  ICP备案:闽ICP备05037997号