2 questions, how is allegro putpixel() so fast and how can I do faster vesa stuff
Question # 1
Im working on a vga/svga graphics library and have a few functions finished like, putpixel, Line, Rect, RectFill. Anyway, I decided to compare my librarys putpixel() function to allegro, I tested how many pixels per second each library could do and allegro got like 3 million and mine got about ninety five thousand. I did both of the tests in vga mode 320x200x256. How does allegro do this!!! My only idea is that allegro is faster because it runs under djgpp which is 32 bit and mine runs under borland (dos 16 bit). I would post the source for my putpixel function but Im at school right now so I cant.
it may have been something like this:
int VgaPutPixel(unsigned int x, int y, int color)
{
x=(320*y)+x;
asm
{
mov bx, 0A000H
mov es, bx
mov bx, x
mov ax, color
mov [es:bx], ax
}
return 0;
}
Question # 2
How can I do faster vesa stuff (bank switching is slooww), is there any way to not use bank switching?
thanks