Mail Archives: djgpp/1998/05/09/07:45:21
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 -