Article View: rec.games.programmer
Article #1055Re: using video-ram in mde 13h (ibm pc)
From: jim moore xd/nda
Date: Tue, 10 Nov 1992 17:51
Date: Tue, 10 Nov 1992 17:51
28 lines
1684 bytes
1684 bytes
Hi Paal.
Yes you can access a buffer which you declare in unused video ram but if you do,
why not use page swapping rather than copy it across? All page swapping involves is
telling the VGA to start the next scan from another place in VGA memory anyway!
Here's how to flip the visual page from the default (at $A000:0000) to another.
Let's assume we have a page in video ram at $A000:8000. To select which page we want
to make visual, we can use this code (where p = page number, 0 or 1):
PROCEDURE VisualPage(p:byte);
VAR ofs : word;
BEGIN
ofs:=$8000*p; { These lines calculate the offset for page 0 at 0000 }
ofs:=ofs + $0C; { or page 1 at 8000, the +$0C is arbitrary }
asm
mov dx,03d4h { These lines redefine the VGA CRTC registers so that }
mov ax,ofs { the next scan starts at ofs, thereby making the page }
out dx,ax { visual. This is faster than copying from a buffer }
end;
END;
I know this works in 320x400x256 mode so it should work in 320x200 mode. Be sure to
clear your buffer or page before you use it otherwise your screen will fill will
garbage.
Good luck, Jim.
Technical Details
Message-ID:
<1992Nov10.175128.14865@ericsson.se>Path:
arc1-ca.pugleaf.net!sparky!uunet!mcsun!sunic!ericom!etlxd10h!etljmmeReferences:
<1992Nov10.102202.3413@alf.uib.no>Show Full Headers
Complete Article Headers
Newsgroups: rec.games.programmer Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!sunic!ericom!etlxd10h!etljmme From: etljmme@etlxd10h.etlxd (jim moore xd/nda) Subject: Re: using video-ram in mde 13h (ibm pc) Message-ID: <1992Nov10.175128.14865@ericsson.se> Sender: news@ericsson.se Nntp-Posting-Host: etlxd10h.ericsson.se Reply-To: etljmme@etlxd10h.etlxd Organization: Ericsson References: <1992Nov10.102202.3413@alf.uib.no> Date: Tue, 10 Nov 1992 17:51:28 GMT Lines: 29