home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 8
/
CDASC08.ISO
/
NEWS
/
554
/
MAI
/
MOVESCRN.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1993-10-07
|
2KB
|
58 lines
{─ Fido Pascal Conference ────────────────────────────────────────────── PASCAL ─
Msg : 365 of 412
From : Sean Palmer 1:104/123.0 14 May 93 16:28
To : Todd Holmes
Subj : TExt screen getImage
────────────────────────────────────────────────────────────────────────────────
TH>I was looking threw a Turbo C++ manual and noted some
TH>procedures that deal with the text screen, such as
TH>Get/PutTextImage. I was wondering if anyone has created one
TH>for Pascal to move/save Text images around the screen like
TH>in C++.
this copies a rectangular section from one video buffer (any size) to
another}
procedure moveScr(var srcBuf;srcX,srcY,width,height,srcBufW,srcBufH:word;
var dstBuf;dstX,dstY,dstBufW,dstBufH:word);assembler;
asm
cld
push ds
lds si,srcBuf {calc src adr}
mov ax,srcBufW
mul srcY
add ax,srcX
shl ax,1
add si,ax
les di,dstBuf {calc dst adr}
mov ax,dstBufW
mul dstY
add ax,dstX
shl ax,1
add di,ax
mov dx,height {num lines}
mov ax,SrcBufW {calc ofs between src lines}
sub ax,width
shl ax,1
mov bx,dstBufW {calc ofs between dst lines}
sub bx,width
shl bx,1
@L: mov cx,width
rep movsw
add si,ax
add di,bx
dec dx
jnz @L
pop ds
end;
var s:array[0..24,0..79,0..1]of char absolute $B800:0;
var d:array[0..11,0..39,0..1]of char;
var i:integer;
begin
for i:=1 to 25*10 do write('+---:---');
moveScr(s,0,0,40,12,80,25,d,0,0,40,12); {copy 40x12 block to buf}
readln;
moveScr(d,0,0,38,10,40,12,s,5,5,80,25); {copy part back to screen}
readln;
end.