delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/05/09/07:45:21

From: viktor DOT lundstrom AT mailbox DOT swipnet DOT se (Viktor Lundstrom)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: 'FAR' under DJGPP
Date: Sat, 09 May 1998 11:35:28 GMT
Organization: A customer of Tele2
Lines: 29
Message-ID: <35563e97.1321765@nntpserver.swip.net>
References: <354a2ab1 DOT 4002764 AT news DOT unisys DOT com DOT br>
NNTP-Posting-Host: mn8.swip.net
Mime-Version: 1.0
Cache-Post-Path: mn8!s-13642 AT dialup237-3-53 DOT swipnet DOT se
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

On Sat, 02 May 1998 14:53:25 GMT, brunobg AT geocities DOT com (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);
Skip the screen variable and for-loop totally and use :
_movedatal(_dos_ds, 0xb8000, IMAGEDATA,
IMAGEDATA_WIDTH*IMAGEDATA_HEIGHT >> 2);
Where _dos_ds is the selector to the dos-area, and 0xb8000 the 32-bit
offset of 0xb800. IMAGEDATA*etc. >> 2 is just the size of the block
divided by four (as movedatal moves long-words). 
DJGPP has no far keyword. You will have to use the _farpokex
instructions. 
>           }
>}
>
>But DJGPP doesn't accept the FAR keyword. How do I do? 
>

- Raw text -


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