
#include "putpix.h"

#ifdef HICOLOR
#define MASK 0x7bef
#else
#define MASK 0x7f7f7f
#endif

void putpix(buftype *buf,int idx,buftype col)
{
    buftype shifted=(col>>1)&MASK;

    buf[idx]=col;
    buf[idx-1]=((buf[idx-1]>>1)&MASK)+shifted;
    buf[idx+1]=((buf[idx+1]>>1)&MASK)+shifted;
    buf[idx-XRES]=((buf[idx-XRES]>>1)&MASK)+shifted;
    buf[idx+XRES]=((buf[idx+XRES]>>1)&MASK)+shifted;
}
