From: varobert AT colba DOT net Message-Id: <3.0.32.19990718051924.00797100@mail.colba.net> X-Sender: varobert AT mail DOT colba DOT net X-Mailer: Windows Eudora Pro Version 3.0 (32) Date: Sun, 18 Jul 1999 05:19:30 -0400 To: djgpp AT delorie DOT com Subject: Re: still got double buffering prob. in 13h mode. Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Reply-To: djgpp AT delorie DOT com At 02:04 PM 7/18/99 +0800, you wrote: Try movedata(_my_ds(),(int)double_buffer,screen,0,320*200); The trick is to cast the pointer to an offset from DS. >Hi Nate & GodOfWar (and others), > >I replaced the '*double_buffer' with plain 'double_buffer', but while >compiling it comes back with: > >48:warning: passing arg 2 of 'movedata' makes integer from pointer without >a cast. > >(This is why I initially used the '*double_buffer') Somewhere else is this >giving me a headache, but where? Must have ovelooked something. > >-- >regards; >Mark. > > >#include >#include >#include >#include > >typedef unsigned char byte; > >short screen; >byte *double_buffer; > >void mode(byte mode){ > union REGS regs; > regs.h.ah=0x00; > regs.h.al=mode; > int86(0x10, ®s, ®s); >} > >main(){ > mode(0x13); > > screen = __dpmi_segment_to_descriptor(0xa000); > double_buffer = (byte *)malloc(320*200); > memset(double_buffer,0,320*200); > > double_buffer[10*320+10] = 4; > > while (inportb(0x3da) & 8); > while (!(inportb(0x3da) & 8)); > movedata(_my_ds(),double_buffer,screen,0,320*200); > > getch(); > mode(0x03); >} > > >