Join Date: Oct 2016
Posts: 833
|
#include <dos.h>
#include <conio.h>
#include <stdio.h>
void setvideo()
{
_AL = 19;
_AH = 0;
geninterrupt(0x10);
}
void returnvideo()
{
_AL = 3;
_AH = 0;
geninterrupt(0x10);
}
void plotxyc(int x, int y, int c)
{
_AX = c;
_CX = x;
_DX = y;
_AH = 0x0c;
geninterrupt(0x10);
}
int GetPixel(int x, int y)
{
int returnvalue;
_CX = x;
_DX = y;
_AH = 0x0d;
geninterrupt(0x10);
_AH = 0;
returnvalue = _AX;
return(returnvalue);
}
void blocks(int x, int y, int m, int c, int z)
{
int matrix[3][10][10] =
{
{
{0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,1,1,0,0,0,0},
{0,0,0,0,1,0,0,0,0,0},
{0,0,0,1,1,1,0,0,0,0},
{0,0,1,0,1,0,1,0,0,0},
{0,0,0,0,1,0,0,0,0,0},
{0,0,0,0,1,0,0,0,0,0},
{0,0,0,1,0,1,0,0,0,0},
{0,0,1,0,0,0,1,0,0,0},
{0,0,0,0,0,0,0,0,0,0}
},
{
{0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,1,1,0,0,0,0},
{0,0,0,0,1,0,0,0,0,0},
{0,0,0,1,1,0,0,0,0,0},
{0,0,0,1,1,1,0,0,0,0},
{0,0,0,0,1,0,0,0,0,0},
{0,0,0,0,1,0,0,0,0,0},
{0,0,0,0,1,0,0,0,0,0},
{0,0,0,1,0,1,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0}
},
{
{0,0,0,0,0,0,0,0,0,0},
{0,1,1,1,1,1,1,1,1,0},
{0,1,0,1,0,0,0,0,1,0},
{0,1,1,1,0,0,0,0,1,0},
{0,1,0,1,1,1,1,1,1,0},
{0,1,1,1,1,0,1,1,1,0},
{0,1,0,0,1,1,1,0,1,0},
{0,1,0,0,1,0,1,0,1,0},
{0,1,1,1,1,1,1,1,1,0},
{0,0,0,0,0,0,0,0,0,0}
}
};
int xpos, ypos, cpos, mpos, zpos;
for(xpos = 0; xpos < 10; xpos++)
{
for(ypos = 0; ypos < 10; ypos++)
{
if(matrix[m][ypos][xpos] == 1)
{
plotxyc(x+xpos, y+ypos, c);
}
else
{
plotxyc(x+xpos, y+ypos, 0);
}
}
}
}
void pause()
{
_AH = 0;
geninterrupt(0x16);
}
int main()
{
int tempx, tempy, tempc, tempm, tempz;
setvideo();
tempc = 12;
tempz = 1;
tempm = 2;
tempy = 99;
for(tempx = 0; tempx < 320-10; tempx = tempx + 10)
{
blocks(tempx, tempy, tempm, tempc, tempz);
}
for(tempz = 0; tempz < 320-10; tempz++)
{
tempm++;
if(tempm > 1)
{
tempm = 0;
}
blocks(tempz, tempy-10, tempm, 10, 10);
pause();
}
for(tempz = tempy-10; tempz < 200-10; tempz++)
{
tempm++;
if(tempm > 1)
{
tempm = 0;
}
blocks(320-10, tempz, tempm, 14, 10);
pause();
}
blocks(320-10, 200-10, tempm, 0, 12);
gotoxy(25, 20);
printf("Help...");
gotoxy(1,1);
printf("www.Abandonia.com");
loop:;
goto loop;
returnvideo();
}
|