Vous n'êtes pas identifié.
voila ta fonction pour tester un pixel:
int readpix (unsigned int x, unsigned int y)
{
unsigned int offset, xmod;
xmod=x%8;
x=( x - xmod );
offset=x * 8 + y;
return ((peekb(segm_video, offset) >> xmod) & 1);//return 1 if lighted or 0 if not.
}
ca semble tres bien mais je ne comprend pas comment l'utiliser.
"segm_video" c'est quoi, je le rmeplace par quoi ?
Hors ligne
je reprend: c'est du chinois. j'ai essayer ca mais ca marche pas (ce qui m'etonne pas puisuque je n'ai rien compris.
#include <conio.h>
#include <dos.h>
void changepixel (unsigned int x, unsigned int y)
{
unsigned int offset, xmod;
unsigned int pic;
xmod=x%8;
x=( x - xmod );
offset=x * 8 + y;
pic=1 << xmod;
pokeb(0x1A20, offset, (pic ^ peekb(0x1A20, offset)));
return;
}
int readpix (unsigned int x, unsigned int y)
{
unsigned int offset, xmod;
xmod=x%8;
x=( x - xmod );
offset=x * 8 + y;
return ((peekb(0x1A20, offset) >> xmod) & 1);//return 1 if lighted or 0 if not.
}
int main()
{changepixel(15,15);
readpix(15,15);
printf("%d",peekb(0x1A20, offset));
getch();
return(0);
}
offset c'est quoi ??? turbo me met a juste titre: variable non definie.
Hors ligne
segm_video est une variable globale qui correspond à 0x1A20
hors de toute fonctions tu met : unsigned int segm_video = 0x1a20;
par contre je ne comprend pas ce que tu veux faire avec
int main() {changepixel(15,15); readpix(15,15); printf("%d",peekb(0x1A20, offset)); getch(); return(0); }
la fonction readpix renvoie quelque chose si le pixel est allumé et 0 s'il est éteint.
int main() { changepixel(15,15); printf("%d", readpix(15,15)); getch(); return(0); }
Voilà ça ça marche.
Hors ligne
j'envoie le truc a ma calculatrice ... la tension monte ... j'appuie sur [menu] .... je lance systemexplorer ... je lance le .exe et................
CA MARCHE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! :jump: :fou: :boire2:
merci bcp !!!!!!!!!!!!!!!!!!!!!!!!!
dans le meme coup, je peux utiliser tes autres fctions
Hors ligne