create a virtual screen!
type
virtualp=^virtuals;
virtuals=array[1..64000] of byte;
get the memory and offset in mem of the virtual screen,
like:
var
virtual:virtualp;
virtseg:word;
getmem( virtual,64000 );
virtseg:=seg(virtual^);
then you should just write to the virtual screen
then swap your virtual page onto the real screen.
{ eg, swap(virtseg,vgaseg); vgaseg=$a000}
Procedure Swap( Source, Destination : Word ); Assembler;
Asm
push ds
mov ax, [Destination]
mov es, ax
mov ax, [Source]
mov ds, ax
xor si, si
xor di, di
mov cx, 32000
rep movsw
pop ds
End;
{ clear screen}
Procedure Cls(w:Word); Assembler;
Asm
push es
mov cx, 32000;
mov es,[w]
xor di,di
mov al,[0]
mov ah,al
rep stosw
pop es
End;
{ putpixel }
Procedure PutPixel( Where : Word; X,Y : Integer; Color : Byte );
Assembler;
Asm
mov ax, [where] { 8 }
mov es, ax { 2 }
mov bx, [X] { 8 }
mov dx, [Y] { 8 }
mov di, bx { 2 }
mov bx, dx { 2 }
shl dx, 8 { 8 }
shl bx, 6 { 8 }
add dx, bx { 3 }
add di, dx { 3 }
mov al, [color] { 8 }
stosb { 11 }
End; { PutPixel() }