La routine Box/Line
Code : Tout sélectionner
ORG 2000H
JMP START
XD DB 0
YD DB 0
XF DB 0
YF DB 0
D DB 0
E DB 0
START:
MOV BL,XD
MOV BH,YD
MOV CL,XF
MOV CH,YF
MOV DL,D
MOV AH,E
INT 41H
IRET
Le programme c :
Code : Tout sélectionner
/* Ecriture en gros caractere */
#define Z 18
#define D 12
main(){
void dessin();
void box();
clrscr();
dessin("www.ledudu.com",0,0);
dessin("Casio FX-890P ",18,0);
box(18,16,172,16,0,19);
}
/* Ecriture d`une ligne */
void dessin(t,dx,dy)
char *t;
int dx,dy;
{ int i=0,j=0,l=0,e=0;
do{
gotoxy(0,0);
printf("%c",t[l]);
if (t[l]=='.') e+=2;
for (i=0;i<8;i++)
for (j=0;j<8;j++)
if (getpixel(i,j))
{box(2*i+Z+D*l-e+dy,2*j+dx,2*i+Z+D*l-e+dy+1,2*j+dx+1,0,20);};
if (t[l++]=='.') e+=4;
}while (t[l]);
}
void box(x,y,z,t,d,e)
int x,y,z,t,d,e;
{pokeb(0,0x2003,x);
pokeb(0,0x2004,y);
pokeb(0,0x2005,z);
pokeb(0,0x2006,t);
pokeb(0,0x2007,d);
pokeb(0,0x2008,e);
call(8192,0);
}
Dernière version : 33s.