delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/04/03:00:32

From: "Alberto Chessa" <achessa AT fiar DOT finmeccanica DOT it>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: 'memcpy' makes pointer from integer??, help!!
Date: 3 Aug 1998 07:21:30 GMT
Organization: TIN
Lines: 36
Message-ID: <01bdbeaf$bb611d20$92c809c0@chessa>
References: <01bdbe2f$08387520$LocalHost AT default>
NNTP-Posting-Host: a-mi35-28.tin.it
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp


Xee'Gh <pekkaka AT dlc DOT fi> wrote in article
<01bdbe2f$08387520$LocalHost AT default>...
> HI, for all you people to know i got rid of my last error by myself but i
> got an other.Thats the
> only one thats stopping my one pcx file shower from working!!.
> 
> ''passing arg 1 of 'memcpy' makes pointer from integer without a cast''
> 
> the line looks like this...
> 
> memcpy(0xA0000, (const void *)buffer, 65536)  <- the buffer holds the
> pictures data.
> 

You cannot access DOS memory directly due to DJGPP paged protected memory
(address 0xA0000 do not match real address 0xA0000!). You have to map the
memory via DPMI or to use the DJGPP service _dos_ds that supply a segment
mapped onto real DOS memory. From Avly's Graphic Programming Guide:
	#include <go32.h>
	#include <dpmu.h>
	#include <sys/movedata.h>
	unsigned char *videoptr=(unsigned char *)0xA0000;
	...
	movedata(_my_ds(), doublebuffer, _dos_ds, videopt, sizeof(*doublebuffer));


> i know that i should use thos farptr farpokew but i just dont know how..
> the faq file is ... aaaarrrgghh!.
> 

Just look at "DJGPP2 Quick Graphic Programming Guide by Avly at
http://www.castle.net/~avly/djgfx.html and other stuff from
http://www.delorie.com/djgpp/doc/. 

- Raw text -


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