delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/01/30/12:49:21

From: Liche <liche AT tp DOT silkera DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Problems with pointers
Date: Sat, 31 Jan 1998 01:13:27 +0800
Organization: New Silkera Network
Lines: 33
Message-ID: <34D20A36.71CA70B9@tp.silkera.net>
References: <34D1B000 DOT 9EFD50DF AT tp DOT silkera DOT net> <34D20527 DOT 253 AT cornell DOT edu>
NNTP-Posting-Host: ts140.tp.silkera.net
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp


A. Sinan Unur wrote:

> Liche wrote:
>
> > void PCXimage::showbuffer()
> > {
> >      dosmemput(imagebuffer, 64000, video_buffer);
> > }
> >
> > A general protection fault occurs, and the program terminates.
> > video_buffer is an  unsigned char * to 0xA0000, the physical address
> > of VGA memory. Does anybody know how to resolve this problem? Please
> > email me for the complete source.  Thanks
>
> this is actually a FAQ in disguise.
>
> try
>   dosmemput(imagebuffer, 64000, 0xa0000);
>
> or, equivalently,
>   movedata(_my_ds(), (unsigned) imagebuffer, _dos_ds, 0xa0000);
>

movedata also requires the size of imagebuffer as the 5th argument.

Liche

>   -- Sinan



- Raw text -


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