Mail Archives: djgpp/1997/11/02/21:24:26
eggbrains AT aol DOT com (Egg brains) writes:
>
> okay, anyway, in my program (a start of a graphics lib -- yes, i know about
> Allegro) i draw pixles to the screen (what else). when i directly wrote to
> the screen ie:
>
> vga = (unsigned char*)MK_FP(0xA000, 0);
> vga[where]=color;
>
> i can draw about 1.6 million pixels per second, however, when using Farnspoke,
> i can draw up to 3+ million pixels per second... why is it so much faster?
>
Try assembler for the first. Or
*((unsigned char*) MK_FP (0xA000, where)) = color;
Make sure you use the same video mode for both methods.
> would using the near access go faster yet?
Most probably not.
>
> anyway, using the Far mode, how would i make selectors to sprites? would i make
> the sprites by define an array (with malloc/new etc...) and then make a
> selctor to it? what about if I change the size/location? i will need to make
> a new selector right? an since you can't delete selectors if i re-size it
> enough will i run out of memmory?
You need not make selector for memory allocated with malloc/new, I don't
know where the selector is, but looking into libc references, _my_ds ()
is a good candidate and alternatively you can get it
from %%ds with inline assembly.
BTW, Allegro has selector in BITMAP structure, so it is all there, I think.
- Raw text -