Sender: mike AT Home-51 DOT inp DOT nsk DOT su To: djgpp AT delorie DOT com Subject: Re: Direct Access vs. Far vs. Near References: <19971101224800 DOT RAA21869 AT ladder01 DOT news DOT aol DOT com> From: Michael Bukin Date: 03 Nov 1997 08:16:25 +0600 In-Reply-To: eggbrains@aol.com's message of 1 Nov 1997 22:48:02 GMT Message-ID: Lines: 36 Precedence: bulk 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.