ftp.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/10/12/08:30:38

From: "Marp" <marp AT 0 DOT 0 DOT 0 DOT 0>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: VBE2.0 w/LFB + GCC
Date: Thu, 12 Oct 2000 08:16:24 -0400
Organization: MindSpring Enterprises
Lines: 52
Message-ID: <8s49vu$k4l$1@slb6.atl.mindspring.net>
References: <6v%E5.29784$L12 DOT 598411 AT news2-win DOT server DOT ntlworld DOT com>
NNTP-Posting-Host: 04.30.99.b8
X-Server-Date: 12 Oct 2000 12:14:54 GMT
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

"Graham Reeds" <grahamr AT dtn DOT ntl DOT com> wrote in message
news:6v%E5.29784$L12 DOT 598411 AT news2-win DOT server DOT ntlworld DOT com...
> Hi.  I'm having problems with my code (why else would I be posting
here..:-)
>

<snip>

> /* FLIPS THE SCREEN */
> void            frameendlfb()
>   {
>   /* wait for retrace */
>   vsync();
>
>   /* copy to lfb */
>   _dosmemputl(primarysurface->dsimage, remainder, videomemory);

The dosmem*() functions are for moving data between memory in the real mode
address space and your program. You can't use those functions for moving
data outside of your program to some location outside of the real mode
address space.

<snip>

>      meminfo.address = (unsigned long)modeinfoblock.physbaseptr;
>       __dpmi_physical_address_mapping(&meminfo);
> //      __dpmi_lock_linear_region(&meminfo);
>       videomemory = meminfo.address;

Ok now you need to create a segment descriptor that spans that linear
address and use the selector returned by the system to access it. You should
be using functions such as movedata() and _far*(). The address you pass to
dosmem*() is the offset within the _dos_ds selector which doesn't include
the memory you want.

>
>       /* try selectors */
> //      videoselector = __dpmi_allocate_ldt_descriptors(1);
> //      __dpmi_set_segment_base_address(videoselector, videomemory);
> //      __dpmi_set_segment_limit(videoselector,
> modeinfoblock.bytesperscanline * modeinfoblock.yresolution + 1);

Ok you have it, but why is it commented out?? Even so, you still didn't use
the correct functions to access it.

Hope this helps.

Marp

<snip>


- Raw text -


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