delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/05/03/12:37:35

Mime-Version: 1.0
To: kirpa AT zfs DOT lg DOT ua, Bruno Barberi Gnecco <brunobg AT geocities DOT com>
From: Nate Eldredge <nate AT cartsys DOT com>
Subject: Re: 'FAR' under DJGPP
Cc: djgpp AT delorie DOT com
Date: Sun, 3 May 1998 09:29:28 -0700
Message-ID: <19980503162926.AAA13143@ppp118.cartsys.com>

At 08:18  5/2/1998 +0300, Kirpa S.I. wrote:
>
>
>Bruno Barberi Gnecco wrote:
>
>> I'd like to output a file generated by TheDraw. It's documentation says
to use:
>>
>> #include <stdio.h>
>> #include <memory.h>
>> #include "file.h" // this is the file containing data
>> int main () {
>>            void far *screen;
>>            int offset = -162;  t
>>            int x;
>>            for (x=0; x<IMAGEDATA_DEPTH; x++) {
>>              (long) screen = 0xB8000000+x*160+offset;
>>              memcpy
(screen,&IMAGEDATA[x*IMAGEDATA_WIDTH*2],IMAGEDATA_WIDTH*2);
>>            }
>> }
>>
>> But DJGPP doesn't accept the FAR keyword. How do I do?
>>
>
>You may define in file "file.h" first line like that:
>
>#define far

No, that won't work in this case. That only applies in cases where objects
have been made `near' and `far' for size reasons. Constructing a
conventional memory pointer doesn't work in DJGPP, since conventional memory
is not directly addressable. Do, however, see FAQ section 18.4.

Nate Eldredge
nate AT cartsys DOT com



- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019