| delorie.com/archives/browse.cgi | search |
| From: | "David Mitchell" <dmitchell AT inet DOT net DOT nz> |
| Newsgroups: | comp.os.msdos.djgpp |
| Subject: | Re: Virtual Screens |
| Date: | Fri, 2 Jul 1999 17:20:39 +1200 |
| Organization: | Inet Ltd, Christchurch, New Zealand |
| Lines: | 39 |
| Message-ID: | <930893939.241152@kyle.inet.net.nz> |
| References: | <7lgctl$7r4$1 AT news5 DOT svr DOT pol DOT co DOT uk> |
| NNTP-Posting-Host: | kyle.inet.net.nz |
| X-Trace: | titan.xtra.co.nz 930893178 4637563 202.50.171.4 (2 Jul 1999 05:26:18 GMT) |
| X-Complaints-To: | abuse AT xtra DOT co DOT nz |
| NNTP-Posting-Date: | 2 Jul 1999 05:26:18 GMT |
| X-Newsreader: | Microsoft Outlook Express 4.72.3110.5 |
| X-MimeOLE: | Produced By Microsoft MimeOLE V4.72.3110.3 |
| Cache-Post-Path: | kyle.inet.net.nz!unknown AT p42-tnt1 DOT inet DOT net DOT nz |
| X-Cache: | nntpcache 2.3.3 (see http://www.nntpcache.org/) |
| To: | djgpp AT delorie DOT com |
| DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
| Reply-To: | djgpp AT delorie DOT com |
This is how I do it.
Note: This code can be very much optimised! And the putPixel method is
missing the clipping code.
char vscreen[64000];
char *scrptr;
void putPixel(int x, int y, char color) {
int offs;
offs = 320*y + x;
vscreen[offs] = color;
}
void flip(void) {
memcpy(scrptr, virt, 64000); // #include <mem.h>
}
int main(void) {
.
.
.
__djgpp_nearptr_enable(); // #include <sys/nearptr.h>
for this.
scrptr = (char*) (__djgpp_conventional_base + 0xa0000); // note 4
zeros because of
// pmode
.
.
.
}
David.
PS the flip takes less than 1ms on a P200
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |