Date: Sun, 13 Feb 2000 10:19:40 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Yoda <cedricbovar AT hotmail DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: Using a doublebuffer with VESA 2.0
In-Reply-To: <883rok$gjq$1@news6.isdnet.net>
Message-ID: <Pine.SUN.3.91.1000213101912.29873b-100000@is>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Reply-To: djgpp AT delorie DOT com
Errors-To: dj-admin AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com
Precedence: bulk


On Sat, 12 Feb 2000, Yoda wrote:

>  unsigned char *videoptr = (unsigned char *)0x0;
>  short our_global_selector = __dpmi_allocate_ldt_descriptors(1);
>  __dpmi_set_segment_base_address(our_global_selector, linear_address);
> 
>  _farpokeb(our_global_selector, videoptr + y*width +x, color);
> 
> void copy_buffer2(void)
>         {
>    movedata(_my_ds(), doublebuffer, our_global_selector, videoptr,
> width*height);
>  }
> 
> I did the same but i get an error at the farpokeb or the movedata.

The above code fails to set the segment limit, so the limit is either
some (small) default value or garbage.  That's why accessing it causes
a GPF.