#undef RGB
#define RGB(r,g,b)          ((r)+((g)<<5)+((b)<<10))

unsigned short *Palette = (unsigned short*)0x5000000;
volatile unsigned short *CompteurScanline = (volatile unsigned short *)0x4000006;

typedef unsigned char car;

void AttendVSync()     {
    while (*CompteurScanline>=160);
    while (*CompteurScanline<160);
}

void CopieDMA (void *source, void *dest, unsigned int nbval, unsigned int mode)     {
    if (mode==DMA_16im || mode==DMA_32im)        {
        REG_DMA3SAD = (unsigned int) source;
        REG_DMA3DAD = (unsigned int) dest;
        REG_DMA3CNT = nbval | mode;
    }
}


