www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/05/02/22:25:04

From: "Christopher Nelson" <paradox AT gye DOT satnet DOT net>
To: <djgpp AT delorie DOT com>
Subject: Re: code to copy screen buffers
Date: Sun, 2 May 1999 14:44:34 -0600
Message-ID: <01be94dc$96118880$LocalHost@thendren>
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 4.71.1712.3
X-MimeOLE: Produced By Microsoft MimeOLE V4.71.1712.3
Reply-To: djgpp AT delorie DOT com

>Does anyone know any other way to swap screen buffers
>from to video memory except using dosmemput(framebuffer, 64000, 0xa0000).
>Can it be done in using inline assembler?


this depends entirely upon which mode you are drawing in.  you can't do it
in any high-res modes unless you're card supports linear frame buffers.  you
can't really do it in modeX either, you have to make four passes over the
same bitmap.

in mode13h, you can:  rep stosb/w/d.  which is almost what dosmemput does.
in fact, many times this call will be inlined by gcc to simply be a rep
stosb/w/d.

set ds as the source selector, es as the destination selector, si as the
source index, and di as the destination index.  set ecx as the number of
transfers.  (e.g. if you are doing doubleword transfers, it would be
(numbytes>>2) (divided by 4), word transfers would be (numbytes>>1), and
byte transfers (numbytes).  the do the rep stos/b/w/d

    -={C}=-






- Raw text -


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