home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Freelog 8
/
Freelog008.iso
/
Prog
/
VGA_C.C
< prev
next >
Wrap
C/C++ Source or Header
|
2000-02-06
|
1KB
|
110 lines
//CODE EN C REALISE PAR SIRACUSA WALTER/wiSdom
//CODE EN ASSEMBLEUR REALISE PAR Gilles Baillou
#include "vga.h"
void InitVGA(void)
{
asm{
mov ax,13h
int 10h
}
}
void InitTexte(void)
{
asm{
mov ax,03h
int 10h
}
}
void CpyBlk2(short xs,short ys,word l,word h,short xd,short yd,bytef *src,bytef *dst)
{
asm{
les di,dst
lds si,src
imul cx,yd,320
add di,cx
add di,xd
imul cx,ys,320
add si,cx
add si,xs
mov bx,320
sub bx,l
mov ax,h
}
continu:
;
asm{
mov cx,l
shr cx,1
rep movsw
adc cx,cx
rep movsb
add di,bx
add si,bx
dec ax
jnz continu
}
//En C ceci donne:
/* register byte i,j;
wordf *s2;
wordf *d2;
src+=(ys<<8)+(ys<<6)+xs;
dst+=(yd<<8)+(yd<<6)+xd;
l=l>>1;
for(j=0;j<h;j++)
{
s2=(wordf *)src;
d2=(wordf *)dst;
for(i=0;i<l;i++) *(d2++)=*(s2++);
src+=320;
dst+=320;
}*/
}
void CpyBnd(short ys,word h,short yd,bytef *src,bytef *dst)
{
asm{
les di,dst
lds si,src
imul cx,yd,320
add di,cx
imul cx,ys,320
add si,cx
mov cx,h
imul cx,320
shr cx,1
rep movsw
adc cx,cx
rep movsb
}
//En C ceci donne:
/* register word i;
dwordf *s4;
dwordf *d4;
src+=(ys<<8)+(ys<<6);
dst+=(yd<<8)+(yd<<6);
s4=(dwordf *)src;
d4=(dwordf *)dst;
h=(h<<6)+(h<<4); //h = (h*320) / 4
for(i=0;i<h;i++) d4[i]=s4[i];*/
}