[comp.sys.ibm.pc] Huge array in Turbo C

mcdonald@uxe.cso.uiuc.edu (11/26/89)

>This is probably a very easy question; the problem is that I know next
>to nothing about C.  I'm trying to recompile the TeX previewer DVIVGA
>to use a super-VGA mode on my monitor, but Turbo C doesn't like the
>code.  (The original is compact model MS C code.)

>The one error I can't seem to get anywhere with is the following:

>Error: Conflicting type modifiers in function getbmap


>static unsigned long huge basebit[ (long)XBIT * (long)(YBIT+2)];
>                                  ^--pointer here

>I then get an error saying that the array is too large.  I don't have
>the definitions of XBIT and YBIT handy, but assume that they come out
>to something larger than 64K. 

I am the author of DVIVGA. There is nothing wrong with that line -
in Microsoft C. Turbo must lack "huge" somethings. The solution is
to allocate several arrays smaller than 64K. You will note that
this array is used only through the "far" pointers generated later
in getbmap by the horrible mess of renormalizing pointers. Just
figure out how to split the array "basebit" into several parts.
But - remember - this is terribly non-obvious - it is a speed hack -
to add 200 bytes beyond what you actually need for the entries in the
array of pointers generated in getbmap, for EACH smaller array.

I have wrapped all the segmentation horrors of the '86 in that one function.

>Actually, I have an even easier question:  does anyone have a copy of
>DVIVGA modified to work with the 800x600x16 or 1024x768x4 modes of a
>256K ATI VGA Wonder card?
Sorry, no. But I do have one for the Video 7 cards.

Doug MCDonald  (mcdonald@aries.scs.uiuc.edu)
               please note new address