delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/07/02/01:09:31

From: "David Dean - [DS]Deaner666" <david AT deanhouse61 DOT freeserve DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Virtual Screens
Date: Thu, 1 Jul 1999 19:28:26 +0100
Organization: Customer of Planet Online
Lines: 38
Message-ID: <7lgctl$7r4$1@news5.svr.pol.co.uk>
NNTP-Posting-Host: modem-146.name33.dialup.pol.co.uk
X-Trace: news5.svr.pol.co.uk 930854645 8036 62.136.176.146 (1 Jul 1999 18:44:05 GMT)
NNTP-Posting-Date: 1 Jul 1999 18:44:05 GMT
X-Complaints-To: abuse AT theplanet DOT net
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2014.211
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

I'm currently trying to get to grasps with graphics programming in DJGPP.
I've managed to get round the protected mode quirks using (the albeit
annoying AT&T) assembly, and can now put pixels to the video segment. My
question now regards setting up a _virtual_ screen to put pixels to, so I
can set up the screen in the background and flip it to VGA without flicker.
I'm using mode 13h, so what is the best way of setting up the 64000 (320 *
200) bytes I need and then being able to reference this virtual screen?
Could I combine a function for putting pixels to this virtual screen with my
current function for putting pixels to VGA by adding another parameter?

Here's my current putpixel function:

/*Puts a pixel of colour col to (x,y) on the VGA screen*/
void PutPixelVGA(int x, int y, unsigned char col)
{
short global_selector;
global_selector = _dos_ds;

    __asm__ __volatile__("
    movw %3, %%es\n
    movl $0xA0000, %%edi\n
    movw %0, %%ax\n
    imulw $320, %%ax\n
    addw %1, %%ax\n
    addw %%ax, %%di\n
    movb %2, %%al\n
    stosb"
    :
    :"g" (y), "g" (x), "g" (col), "g" (global_selector)
    );
}

Thanks in advance,

David Dean
(DJGPP really is quirky isn't it?)


- Raw text -


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