1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
| #include <conio.h>
#include <windows.h>
#define ECR ((short far*)0xB8000000) //Constante ECR avec l'@base mem video
#define PutChar(X,Y,car) (*(ECR+80*Y+X)=car) //macro PutChar
#define GetChar(X,Y) (*(ECR+80*Y+X)) //macro GetChar
//Couleur de fond
#define F_ROUGE 0x4000
#define F_VERT 0x2000
#define F_BLEU 0x1000
//Couleur d'un caractre
#define C_ROUGE 0x0400
#define C_VERT 0x0200
#define C_BLEU 0x0100
//spécial
#define CLIGNE 0x8000
#define BRILLE 0x0800
int main()
{
short toto,i=0;
char tab[8]={"coucou"};
while(i<8)
{
PutChar(8+i,13,tab[i]|(C_ROUGE|CLIGNE)); //afficher en 8,13
toto=(GetChar(8+i,13)); //lire en 8,13
PutChar(13+i,23,toto); //ecrire le contenu de 8,13 en 13,23
i++;
}
//getch();
system("pause");
return 0;
} |
Partager