Article View: rec.games.programmer
Article #73Re: EGA
From: John A. Slagel
Date: Tue, 03 Nov 1992 01:12
Date: Tue, 03 Nov 1992 01:12
60 lines
3347 bytes
3347 bytes
saxena@bohr.physics.purdue.edu (Virendra K. Saxena) writes:
> Ok, I know that before the VGA came out, people actually programmed
>for the EGA card. Does anyone have any code for fast bitmap writes in EGA.
Not I.
> Also, a couple of days ago, someone posted some DMA code for VGA
>bitmap routines(x by y array of colors, and then DMA the color value to VRAM).
>What is the difference between this and something like xblt?
They're basically the same... I'm not sure what you mean by 'xblt'
but... There are a bunch of name for "putting a block of pixel values
on the screen": BitBlt, sprite, icon, BitBlock, Image... The various
forms differ in:
-Pixel data format (Run-length encoded, planar, packed, encoded, masked)
-Type of image (A block of pixels, an odd-shaped hero...)
-The video mode (ModeX, EGA, VGA 13h)
-Collision detection
The code for the (x by y array of colors) fell into this catagory:
-Packed 8 bit per pixel row column order data.
-Destination: VGA mode 13h
-Assumes a rectangular block of pixels.
I have code for ModeX planar sprites, which more or less means fairly
fast, can handle non-rectangular sprites, can check for collisions.
>When I try to
>write many bitmaps to the screen one after the other, there is a lot of
>flickering. Why does this happen?
Because of the horizontal retrace on the montitor... The electron
gun sweeps down the monito while drawing the pixels, and then disappears
and goes up to the top again. It does the at 50-70 times a second.
Lets says the gun is going down and is at row 30. You draw a figure
on rows 10-20 and it won't appear until the gun goes all the way
through the screen again (1/50 of a second later). Lets say you wait
for a little bit of time, and then erase it, preparing to draw the
figure in its next position... But, wonder if the gun doesn't pass
through the figure again until after you erase it? Then the figure
will not appear, and the next time it might, which will give the
appearence of flicker... There are many different ways flicker can
happen... just remember that slow electron gun sweeping down and
redrawing what is *CURRENTLY* in memory.
How to stop it?
1. Wait for the electron gun to get to the bottom of the screen
and then do all the redraws before it gets back up to the top.
2. Or, use two pages... Draw on one while the gun shows the other,
then flip 'em after waiting for one verticle retrace period.
(To make sure the page got displayed.)
3. Or, use three pages... Then you don't need to wait for verticle
retrace.
Hope this helps.
--
------------------------------------------------------------------------
John A. Slagel, email: jas37876@uxa.cso.uiuc.edu
Technical Details
Message-ID:
<Bx48pI.63D@news.cso.uiuc.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!ogicse!uwm.edu!ux1.cso.uiuc.edu!news.cso.uiuc.edu!uxa.cso.uiuc.edu!jas37876References:
<8636@dirac.physics.purdue.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!ogicse!uwm.edu!ux1.cso.uiuc.edu!news.cso.uiuc.edu!uxa.cso.uiuc.edu!jas37876 From: jas37876@uxa.cso.uiuc.edu (John A. Slagel) Newsgroups: rec.games.programmer Subject: Re: EGA Message-ID: <Bx48pI.63D@news.cso.uiuc.edu> Date: 3 Nov 92 01:12:52 GMT Article-I.D.: news.Bx48pI.63D References: <8636@dirac.physics.purdue.edu> Sender: usenet@news.cso.uiuc.edu (Net Noise owner) Organization: University of Illinois at Urbana Lines: 60