From: csantill AT lausd DOT k12 DOT ca DOT us Message-ID: <341CACD6.7148@lausd.k12.ca.us> Date: Sun, 14 Sep 1997 20:37:54 -0700 MIME-Version: 1.0 To: djgpp AT delorie DOT com Subject: Re: Problem with vitual screens in mode 0x13 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Precedence: bulk from: csantill AT lausd DOT k12 DOT ca DOT us Your line \\ char *video=(char *)0xA0000; is wrong. Try this code: ................ #include #include #include #include #include #include #include #include // The includes are from my original file - circle/box/line snipped out // I owe a big thanx to Sinan for my receipt of some actually working VGA // code. THAAAAAAAAAAAAAAAANNNNNNNNXXXXXXXXXXXXXXXXXXX!!!!!!!!!!!!! :] enum GR_MODE{GR_INVALID=-1, GR_TEXT=0x03, GR_VGA=0x13}; enum GR_MODE Set_GR_Mode(enum GR_MODE mode) { __dpmi_regs r; memset(&r, 0, sizeof(r)); r.x.ax=mode; return(__dpmi_int(0x10,&r) ? GR_INVALID:mode); } // ************************************************************************ void Put_Pix_Far(int x, int y, char c) { _farpokeb(_dos_ds, 0xA0000+(y<<8)+(y<<6)+x,c); return; } // ************************************************************************ void Put_Pix_Near(int x, int y, char c) { char *v_m=(char *)(0xA0000+__djgpp_conventional_base); v_m[(y<<8)+(y<<6)+x] = c; } ............... You can modify fill screen to send to your char pointer but you would just be including to ptr headers & adding size to your EXE. It might be better to just malloc a buffer & double buffer from that buffer to 0xA0000 using the farnspokew(it moves 4 bytes at a time). On my P120/16MB/1MB video, I get 192 fill screens per sec w/all optimizations turned on(-09 -m486).