I have entered Protect Mode. I planning made my own gamesince a years ago, Now I have accessed the Video Memory through Protected Mode.
What I need:

Thank you.

NB: I upload the test source, Run it from DOS. Press esc and it restarted.
Posted on 2003-07-02 21:54:50 by realvampire
have some algorithms for you (written in c, shoud be no problem to translate) - they are hardcore-optimized, no need to understand them :). the brilliant thing about them is that you don't need the fpu!!

``````
void line(int x, int y, int x2, int y2, dword color)
{ int i, steep = 0, sx, sy, dx, dy, e;

dx = ABS(x2 - x);
sx = ((x2 - x) > 0) ? 1 : -1;
dy = ABS(y2 - y);
sy = ((y2 - y) > 0) ? 1 : -1;

if(dy > dx) {
steep = 1;
x ^= y;  // swap x and y
y ^= x;
x ^= y;
dx ^= dy; // swap dx and dy
dy ^= dx;
dx ^= dy;
sx ^= sy; // swap sx and sy
sy ^= sx;
sx ^= sy; //the ^=-operator is an xor sx, sy
}

e = 2 * dy - dx;
for(i = 0;i < dx;i++)	{
if(steep) putpixel(y, x, color);
else  putpixel(x, y, color);
while(e >= 0) {
y += sy;
e -= 2 * dx;
}
x += sx;
e += 2 * dy;
}
putpixel(x2, y2, color);
}

void circle(int xc, int yc, int r, dword color) {
int x = 0, y = r, d = 2 * (1 - r);

while(y >= 0) {
putpixel(xc + x, yc + y, color);
putpixel(xc + x, yc - y, color);
putpixel(xc - x, yc + y, color);
putpixel(xc - x, yc - y, color);
if(d + y > 0)  {
y -= 1;
d -= (2 * y * max_x / max_y) - 1;
}
if(x > d) {
x += 1;
d += (2 * x) + 1;
}
}
``````

make use of them, have fun!
Posted on 2003-07-03 14:03:33 by hartyl
What is ABS? I will try to translated it. But hartyl can you give me the shell code?:grin: (Im a bit lazzy to translated it.).

:alright: :stupid:
Posted on 2003-07-03 19:56:27 by realvampire