Mail Archives: djgpp/1999/07/18/05:21:39
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 <stdlib.h>
>#include <dos.h>
>#include <sys/movedata.h>
>#include <dpmi.h>
>
>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);
>}
>
>
>
- Raw text -