AJ> KK> referring to the vesa modes, such as 640x480x256?
AJ> Yes, that's right
This seems to work. My vertical elipses still suck tho.. :)
/*_|_| VESATEST.CPP PUBLIC DOMAIN PART 1 OF 2
_|_|_| Example of using 800x600 and 640x480 VESA modes.
_|_|_| No warrantee or guarantee. Kurt Kuzba. (8/24/1997)*/
#include
#include
#include
#include
class Vesamodes {
public:
Vesamodes(int);
~Vesamodes(void);
void Dot(int, int, int);
void Line(int, int, int, int, int);
void Circle(int, int, int, int, int, int, int);
private:
void Disk(int, int, int r, int c, int hg, int wd);
int High, Wide, Color;
};
Vesamodes::Vesamodes(int mode = 0)
{
switch(mode)
{
case 800: High = 600; Wide = 800; mode = 0x103; break;
default: High = 480; Wide = 640; mode = 0x101; break;
}
Color = 7;
_asm {
mov ax, 4F02h;
mov bx, mode;
int 10h;
}
}
void Vesamodes::Dot(int x, int y, int c)
{
long po, pa, px = (long)x, py = (long)y;
int o;
static int a = 0;
if(x = Wide || y = High) return;
switch(Wide)
{
case 800: po = pa = (py << 9) + (py << 8) + (py << 5) + px;
break;
default: po = pa = (py << 9) + (py << 7) + px; break;
}
po &= 0xffffL;
pa /= 0x10000L;
o = (int)po;
if(a != (int)pa)
{
a = (int)pa;
_asm {
mov ax, 4F05h;
xor bx, bx;
mov dx, a;
int 10h;
}
}
_asm{
mov ax, 0A000h;
mov di, o;
mov es, ax;
mov ax, c;
stosb;
}
}
void Vesamodes::Circle(int xc, int yc, int r,
int c, int WD = 0, int HG = 0, int dsk = 0)
{
int x = 0, d = (1 - r) << 1, w;
HG = HG ? HG : High;
WD = WD ? WD : Wide;
w = (WD / HG) << 1;
if(dsk)
{
Disk(xc, yc, r, c, HG, WD);
}
else
{
while(r >= 0)
{
Dot(xc + x, yc + r, c);
Dot(xc + x, yc - r, c);
Dot(xc - x, yc + r, c);
Dot(xc - x, yc - r, c);
if(d + r > 0)
d -= (w * --r) - 1;
if(x > d)
d += ((++x) << 1) + 1;
}
}
}
/*_|_| end VESATEST.CPP PUBLIC DOMAIN PART 1 OF 2 */
> ] Tagline!?! I thought suicide note! [ Jack Kevorkian ]...
---
---------------
* Origin: *YOPS ]I[* 3.1 GIG * RA/FD/FE RADist * Milwaukee, WI (1:154/750)
|