salut

voila mon code (mon premier vrais programme graphique depuis que j'ai découvert TurboC ilya quelques jours), c'ets un effet plasma sous VGA, comme en qbasic
Code : C
Code:
#include <stdlib.h>
#include <stdio.h>
#include <dos.h>
#include <io.h>

static char Palette[4*3] = {0,0,0,0,0,63,0,63,0,63,0,0};
union REGS regset;
struct SREGS sregs;

void load13h()
{
        regset.x.ax = 0x0013;
        int86(0x10, &regset, &regset);
}
void exit13h()
{
        getch();
        regset.x.ax = 0x0003;
        int86(0x10, &regset, &regset);
}
void drawpx(int x, int y, int coul)
{
        int ptr = (320*y+x);
        poke(0xA000,ptr,coul);
}
int getpx(int x, int y)
{
        int ptr = (320*y+x);
        return peek(0xA000,ptr);
}
void pal( unsigned char i, unsigned char r, unsigned char v, unsigned char b)
{

        outp(0x3c8, i);
        outp(0x3c9, r);
        outp(0x3c9, v);
        outp(0x3c9, b);
}

int main()
{

int color;
int CA,CB,CC,CD,CE,CF,CG,CH,CI;
long ptr;
load13h();
        for(ptr=0; ptr<=64000;ptr++)
        {
                color=rand()%255;
                poke(0xA000,ptr,color);
        }
        for(ptr=0; ptr<=63679;ptr++)
        {
                CA=peek(0xA000,ptr+321);
                CB=peek(0xA000,ptr+320);
                CC=peek(0xA000,ptr-321);
                CD=peek(0xA000,ptr-320);
                CE=peek(0xA000,ptr+319);
                CF=peek(0xA000,ptr-319);
                CG=peek(0xA000,ptr+1);
                CH=peek(0xA000,ptr-1);
                CI=peek(0xA000,ptr);
                color = (CA+CB+CC+CD+CE+CF+CG+CH+CI)/9;
                poke(0xA000,ptr,color);
        }
exit13h();

}

mais voila, il me plante windows avec une opération non conforme.

voyez vous une erreur ?

merci, ++ Tix.