很酷的火焰
来源:互联网 发布:淘宝运营团队结构 编辑:程序博客网 时间:2024/04/28 14:51
/*-------------------vga13h.h----------------*/
/*********************************************************/
/* VGA13H模式函数 */
/*********************************************************/
/*********************************************************/
# if !defined(__DOS_DEF_)
# include <dos.h>
# endif
/* 此处定义了一些通用的宏 */
# define BYTE unsigned char
# define WORD unsigned int
# define DWORD unsigned long
# define BOOL BYTE
# define TRUE 1
# define FALSE !TRUE
/* BIOS 8*8 西文字库的段地址和偏移量 */
WORD FONT_SEG;
WORD FONT_OFF;
void setmode();
void waitkey();
void closemode();
void GetFontAdd();
void locate(int Line,int Col);
void pset(int x,int y,BYTE color);
void setpal(int Color,BYTE r,BYTE g,BYTE b);
BYTE ScanKey(void);
BYTE point(int x,int y);
/* 获取BIOS 8*8 西文字库的段地址和偏移量 */
void GetFontAdd()
{
struct REGPACK regs;
regs.r_bx=0x0300;
regs.r_ax=0x1130;
intr(0x10,®s);
FONT_SEG=regs.r_es;
FONT_OFF=regs.r_bp;
}
/* 等待键盘输入 */
void waitkey()
{
_AX=0;
geninterrupt(0x16);
}
/* 设置VGA 13H模式 */
void setmode()
{
_AX=0x13;
geninterrupt(0x10);
GetFontAdd();
}
/* 设置文本模式 */
void closemode()
{
_AX=0x3;
geninterrupt(0x10);
}
/* 设置调色板 */
void setpal(int Color,BYTE r,BYTE g,BYTE b)
{
outportb(0x3c8,Color);
outportb(0x3c9,r);
outportb(0x3c9,g);
outportb(0x3c9,b);
}
/* 屏幕定位(用于输出字符)*/
void locate(int Line,int Col)
{
_DH=Line;
_DL=Col;
_AH=2;
_BX=0;
geninterrupt(0x10);
}
/* 从键盘缓冲区内直接读出扫描码 */
BYTE ScanKey(void)
{
int start,end;
WORD key=0;
start=peek(0,0x41a);
end=peek(0,0x41c);
if (start==end) return(0);
else
{
key=peek(0x40,start);
start+=2;
if (start==0x3e) start=0x1e;
poke(0x40,0x1a,start);
return(key/256);
}
}
/* 在(X,Y)处绘点 */
void pset(int x,int y,BYTE color)
{
pokeb(0xa000,y*320+x,color);
}
/* 取(X,Y)处颜色 */
BYTE point(int x,int y)
{
return peekb(0xa000,y*320+x);
}
/*---------------------------flame-------------------------*/
# include <stdlib.h>
# include "vga13h.h"
# include <dos.h>
void main()
{
int i,j;
unsigned int x,y,c;
setmode();
for (x=1;x<=32;x++)
{
setpal(x, x*2-1, 0, 0 );
setpal(x+32, 63, x*2-1, 0 );
setpal(x+64, 63, 63, x*2-1);
setpal(x+96, 63, 63, 63 );
}
while(ScanKey()!=1)
{
/*
for (i=0;i<16;i++)
for (j=0;j<16;j++)
pset(random(300)+j,random(150)+i,random(256));
*/
for (x=0;x<320;x+=2)
{
for (y=1;y<=202;y+=2)
{
c=(point(x,y)+point(x+2,y)+point(x,y+2)+point(x+2,y+2))>>2;
if (c--)
{
poke(0xa000,(y-2)*320+x,(c<<8)+c);
poke(0xa000,(y-1)*320+x,(c<<8)+c);
}
}
y-=2;
pset(x,y,random(320));
}
}
closemode();
}
/*********************************************************/
/* VGA13H模式函数 */
/*********************************************************/
/*********************************************************/
# if !defined(__DOS_DEF_)
# include <dos.h>
# endif
/* 此处定义了一些通用的宏 */
# define BYTE unsigned char
# define WORD unsigned int
# define DWORD unsigned long
# define BOOL BYTE
# define TRUE 1
# define FALSE !TRUE
/* BIOS 8*8 西文字库的段地址和偏移量 */
WORD FONT_SEG;
WORD FONT_OFF;
void setmode();
void waitkey();
void closemode();
void GetFontAdd();
void locate(int Line,int Col);
void pset(int x,int y,BYTE color);
void setpal(int Color,BYTE r,BYTE g,BYTE b);
BYTE ScanKey(void);
BYTE point(int x,int y);
/* 获取BIOS 8*8 西文字库的段地址和偏移量 */
void GetFontAdd()
{
struct REGPACK regs;
regs.r_bx=0x0300;
regs.r_ax=0x1130;
intr(0x10,®s);
FONT_SEG=regs.r_es;
FONT_OFF=regs.r_bp;
}
/* 等待键盘输入 */
void waitkey()
{
_AX=0;
geninterrupt(0x16);
}
/* 设置VGA 13H模式 */
void setmode()
{
_AX=0x13;
geninterrupt(0x10);
GetFontAdd();
}
/* 设置文本模式 */
void closemode()
{
_AX=0x3;
geninterrupt(0x10);
}
/* 设置调色板 */
void setpal(int Color,BYTE r,BYTE g,BYTE b)
{
outportb(0x3c8,Color);
outportb(0x3c9,r);
outportb(0x3c9,g);
outportb(0x3c9,b);
}
/* 屏幕定位(用于输出字符)*/
void locate(int Line,int Col)
{
_DH=Line;
_DL=Col;
_AH=2;
_BX=0;
geninterrupt(0x10);
}
/* 从键盘缓冲区内直接读出扫描码 */
BYTE ScanKey(void)
{
int start,end;
WORD key=0;
start=peek(0,0x41a);
end=peek(0,0x41c);
if (start==end) return(0);
else
{
key=peek(0x40,start);
start+=2;
if (start==0x3e) start=0x1e;
poke(0x40,0x1a,start);
return(key/256);
}
}
/* 在(X,Y)处绘点 */
void pset(int x,int y,BYTE color)
{
pokeb(0xa000,y*320+x,color);
}
/* 取(X,Y)处颜色 */
BYTE point(int x,int y)
{
return peekb(0xa000,y*320+x);
}
/*---------------------------flame-------------------------*/
# include <stdlib.h>
# include "vga13h.h"
# include <dos.h>
void main()
{
int i,j;
unsigned int x,y,c;
setmode();
for (x=1;x<=32;x++)
{
setpal(x, x*2-1, 0, 0 );
setpal(x+32, 63, x*2-1, 0 );
setpal(x+64, 63, 63, x*2-1);
setpal(x+96, 63, 63, 63 );
}
while(ScanKey()!=1)
{
/*
for (i=0;i<16;i++)
for (j=0;j<16;j++)
pset(random(300)+j,random(150)+i,random(256));
*/
for (x=0;x<320;x+=2)
{
for (y=1;y<=202;y+=2)
{
c=(point(x,y)+point(x+2,y)+point(x,y+2)+point(x+2,y+2))>>2;
if (c--)
{
poke(0xa000,(y-2)*320+x,(c<<8)+c);
poke(0xa000,(y-1)*320+x,(c<<8)+c);
}
}
y-=2;
pset(x,y,random(320));
}
}
closemode();
}
- 很酷的火焰
- PS非常火焰的火焰字效果
- 火焰的棺材
- 望着药鼎内翻腾的火焰
- 火焰
- PhotoShop打造超酷火焰中燃烧的金…
- 燃起新的生命火焰
- 爱是生命的火焰
- flash火焰燃烧的文字效果
- 火焰检测的一些名词解释
- 生成RGW的火焰图
- 基于GPU编程的粒子火焰
- 模仿仿真火焰的设备和方法
- 一堂火焰下的领导课
- <D3D> 二维火焰实现的算法
- tyvj 火焰巨魔的惆怅
- 火焰之纹章的各种计算
- 粒子系统(2) 火焰的制作
- 一个简单的文本编辑器。(是在DEV C++下写的)
- /*************** C内嵌汇编示例 ***************/
- 如何给键盘加锁
- VNC settings for Linux
- 如何将十六进制数转换为十进制数
- 很酷的火焰
- new操作符的使用问题[ask in smth]
- 大家在申请内存时都是如何做的?[ask in smth]
- Sql Server实用操作小技巧集合
- SQL SERVER日志清除的两种方法
- 删除数据库中重复数据的几个方法
- TabPane 选项卡
- Sql Server数据库的备份和恢复措施
- 存储过程编写经验和优化措施