#include "stdio.h" #include #include #include #include #define PI 3.141 #define YMAX 50 #define XMAX 80 #define YMIN 0 #define XMIN 0 #define Dframe 1 #if !defined(PI) #define PI 3.1415927 #endif #if !defined(VGA) #define VGA 0xA000 #endif struct REGPACK rp; /* Define Global for wavetable*/ unsigned char waves[256]; unsigned char Pall[256][3], Pall2[256][3]; unsigned char *vga = (unsigned char *) MK_FP(0xA000, 0); char far *ruutu = (char far *) 0xb8000000; void Set50L() { rp.r_ax=0x1112; rp.r_bx=0; intr(0x10,&rp); rp.r_ax=0x1200; rp.r_bx=0x20; intr(0x10,&rp); } void Pal(unsigned char ColorNo, unsigned char R, unsigned char G, unsigned char B) { outp (0x03C8,ColorNo); /* here is the pallette color I want to set */ outp (0x03C9,R); outp (0x03C9,G); outp (0x03C9,B); } void SetMCGA() { _AX = 0x0013; geninterrupt (0x10); } void SetText() { _AX = 0x0003; geninterrupt (0x10); } /* Create Wavetable */ void create_wave() { int i; for (i=0; i<256;i++) waves[i] = (unsigned char) (40*(1+sin(i*2*PI/256))); } /* Play Plasma routine */ void plasmah() { int x,y,l,temp=0, colnum=0, redvalue=0; unsigned char pos1, pos2, pos3, pos4; unsigned char tps1, tps2, tps3, tps4; unsigned char spd1, spd2, spd3, spd4; unsigned char col; int ymaxi=YMAX, xmaxi=XMAX, ymin=YMIN, xmin=XMIN; create_wave(); /* Create the wave table*/ /* Set up the variables for the plasma*/ spd1=1;spd2=2;spd3=3;spd4=4; pos1=pos2=pos3=pos4=0; /* Set50L();*/ for(l=0;l<8000;ruutu[l+=2]='v',ruutu[l+=2]='l',ruutu[l+=2]='p'); for(l=0;l<255;l++){Pal(l,l,0,0);} l=0; while (l++<40) { /* Repeat the effect until keypress*/ /* Increment to next frame*/ tps1=pos1; tps2=pos2; y=0; while (y79)x=79; if(y>49)y=49; ruutu[y*160+x*2]=ruutu[y*160+x*2]+1; if(x==0)x=1; if(y==0)y=1; c=random(4); if (c==0) x2--; else if (c==1) x2++; else if (c==2) y2--; else if (c==3) y2++; if(x2>79)x2=79; if(y2>49)y2=49; ruutu[y2*160+x2*2]=0; if(x2==0)x2=1; if(y2==0)y2=1; } Pal(0,255,255,0); printf("vlp"); } for(l=0;l<8000;l++)ruutu[l]=10; for(l=0;l<8000;) {ruutu[l++]='v';ruutu[l++]='l';ruutu[l++]='p';} l2=0; for(l=0;l<255;l++) { Pal(l,l<<2,0,0); } /* tulijutska(); plasmah();*/ for(l=0;l<8000;l++) ruutu[l]=0; l2=0;v=0; printf("\n\n\n\n\n\n\n\n\n\n\n\bvlp vlp vlp vlp vlp virtuaalinen valopumppu vlp vlp vlp vlp"); for(l=0;l<400000;l++) { Pal(0,63,0,0); delay(1); Pal(0,50,0,0); delay(1); Pal(0,40,0,0); delay(1); Pal(0,30,0,0); delay(1); Pal(0,20,0,0); delay(1); Pal(0,10,0,0); delay(1); Pal(0,0,0,0); delay(1); Pal(0,10,0,0); delay(1); Pal(0,20,0,0); delay(1); Pal(0,30,0,0); delay(1); Pal(0,40,0,0); delay(1); Pal(0,50,0,0); delay(1); Pal(0,63,0,0); delay(1); } Pal(1,0,0,0); SetText();Set50L(); for(i=0;i