Mail Archives: djgpp/1996/11/17/05:42:29
From: | Matt Craighead <craighea AT citilink DOT com>
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | Virtual Screens with DJGPP
|
Date: | Sat, 16 Nov 1996 12:58:09 -0800
|
Organization: | (missing)
|
Lines: | 32
|
Message-ID: | <328E2AE1.2EA@citilink.com>
|
Reply-To: | craighea AT citilink DOT com
|
NNTP-Posting-Host: | ppp31.citilink.com
|
Mime-Version: | 1.0
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
I'm writing a program that uses a virtual screen to eliminate screen
flicker when something changes. So what's the best way to update the
screen? (640x480x256, supporting VESA 1.x) This is what I'm doing,
essentially:
#define set_bank(bank) // I forget the two interrupts... put them in
here
#define FULL_BANKS 4
#define REMAINING_BYTES (640*480 - FULL_BANKS*65536)
void screen_update(void)
{
int bank;
__dpmi_regs regs;
for (i = 0; i < FULL_BANKS; i++) {
set_bank(bank);
dosmemput(&virtual_screen[0] + 65536*bank, 65536, 0xA0000);
}
set_bank(FULL_BANKS);
dosmemput(&virtual_screen[0] + 65536*4, REMAINING_BYTES, 0xA0000);
}
This seems to run in about 1/75 of a second on my Pentium 133 with an
STB Vision PCI video card, which is going to be fine for that, but for
slower computers, it starts to get pretty bad, 1/9 of a second on my
486-33 with an ISA video card, and I want to support down to that
level. Is there some fast way to do this without requiring VBE 2.0 or
such?
--
Matt Craighead
- Raw text -