Mail Archives: djgpp/2000/10/11/11:45:28
From: | "Graham Reeds" <grahamr AT dtn DOT ntl DOT com>
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | VBE2.0 w/LFB + GCC
|
Lines: | 65
|
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
|
Message-ID: | <6v%E5.29784$L12.598411@news2-win.server.ntlworld.com>
|
Date: | Wed, 11 Oct 2000 16:17:04 +0100
|
NNTP-Posting-Host: | 62.254.83.0
|
X-Complaints-To: | abuse AT ntlworld DOT com
|
X-Trace: | news2-win.server.ntlworld.com 971277378 62.254.83.0 (Wed, 11 Oct 2000 16:16:18 BST)
|
NNTP-Posting-Date: | Wed, 11 Oct 2000 16:16:18 BST
|
Organization: | ntlworld News Service
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Reply-To: | djgpp AT delorie DOT com
|
Hi. I'm having problems with my code (why else would I be posting here..:-)
After lots of tweaking and hacking at my code, swapping various lines of
code, and what-have-you I finally got it so it doesn't balk when I use
_dosmemputl() to flip images to the screen via the LFB. The code is a bit
long, so I haven't posted it all here, only the few lines that are relevant.
The rest of the source is available from my homepage at
http://homepage.dtn.ntl.com/grahamr/vbe2.0.zip
/* FLIPS THE SCREEN */
void frameendlfb()
{
/* wait for retrace */
vsync();
/* copy to lfb */
_dosmemputl(primarysurface->dsimage, remainder, videomemory);
return;
}
/*
** CODE FRAGMENT FROM SETVBEMODE()
*/
/* vbe >2.0 */
/* check for lfb */
if (modeinfoblock.modeattributes & 0x08)
{
/* lfb available */
mode += 0x4000;
/* get videomemory address */
meminfo.size = (unsigned long)(modeinfoblock.bytesperscanline *
modeinfoblock.yresolution);
meminfo.address = (unsigned long)modeinfoblock.physbaseptr;
__dpmi_physical_address_mapping(&meminfo);
// __dpmi_lock_linear_region(&meminfo);
videomemory = meminfo.address;
/* 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);
/* set up lfb frameend() */
remainder = (modeinfoblock.bytesperscanline *
modeinfoblock.yresolution) / 4;
frameend = &frameendlfb;
}
It compiles perfectly, but unfortunately when it flips it doesn't display
anything. It is supposed to display a poo startfield with a crap purple
face that bounces around. Any help would be appreciated.
P.S. Relevant machine specs are P300MMX (yes a P55C o/c to 300), 64mb Ram,
S3 ViRGE/DX.
--
Stay Lucky, Graham "Mournblade" Reeds.
ICQ No.: 30514803
http://homepage.dtn.ntl.com/grahamr
- Raw text -