Mail Archives: djgpp/1996/10/16/14:26:51
About the nearptr topic I wrote:
>> Yeap! that's the good part, you can't destroy DOS or Losse with a wrong
>> calculus, and (at least for my program) is equally fast than the nearptr
>> methode (that's a really HACK :-), and I don't need to make strange arithmetic
>> adding the __djgpp_base... so from my point of view the load of the selector
>> isn't a problem (at least isn't worst than the base addition). Even more: if
>> your program have a really fast part where you don't call any of the library
>> functions you can load the selector only one time and reload it only when you
>> suspect that the value was loosed, I'm doing this and works OK. In the other
>> hand if I use nearptrs I must add the base in tons of parts so is worst.
>> That's my opinion, I know that Eli thinks that the nearptrs are faster than
>> this methode.
And Leathal replied:
>Hey dudes...
>I started using selectors (such as %fs) but gave up after about 2 days.
>Why?
>Every time I want to write to a section of the graphics screen, I call
>a routine - say blit. Everytime blit is called, I have to reload the
>selector. Every time I exit the blit routine, I have to restore the
>selector.
>Using near pointers, you never have to worry about that. And I have
>never
>written a program where the __djgpp_conventional_base changes... could
>someone explain to me a situation where it does? I have never
>encountered
>this when only running my application (I do just about everything under
>Win95 too... :)
>Just have a variable gfx_screen which points to the physical memory area
>of the graphics screen, add the __djgpp_conventional_base to it, and
>then
>always just use that variable. Easy, no?
Well my program doesn't restore the selector all the time, just only when I
enter in the critical zone (6 osciloscopes, 6 vumeters, 2 Spectral analizers,
the note of each of the 4 channels with me own fonts, the name of each of the
instruments of each channel and more at 160 fps) and restore the value when I
leave this zone (after I played a MOD for example).
In this way the addressing to the video memory is selector:offset and not
base+offset, simpler in the code, and I don't loose the protection of the
memory, so is much more easy to catch a wild pointer in my code.
SET
********************************************************************************
Salvador Eduardo Tropea (SET) - salvador AT inti DOT edu DOT ar
Work: INTI (National Institute of Industrial Technology) Sector: ICE
(Electronic Control & Instrumentation)
Post (Home): Curapaligue 2124 - Caseros (1678)- Buenos Aires - Argentina
- Raw text -