rem: mask = brush->pattern[ ( v + brush->yorigin ) & 7 ];
add: mask = pattern[ ( v + brush->yorigin ) & 7 ];
context: ui_patblt(uint8 opcode,	  /* dest */ int x, int y, int cx, int cy,	  /* brush */ BRUSH *brush, int bgcolour, int fgcolour){  // TODO: This function is totally fucked up and shout be rewritten    x += amiga_window->BorderLeft;  y += amiga_window->BorderTop;  switch (brush->style)  {    case 0:	/* Solid */      amiga_blt_rastport( amiga_window->RPort, x, y, // Not really used			  amiga_window->RPort, x, y,			  cx, cy,			  ( opcode ^ 3 ) << 4   /* B is always 1 */ );      break;    case 3:	/* Pattern */    {      struct RastPort rp;      InitRastPort( &rp );          rp.BitMap = amiga_get_tmp_bitmap( cx, cy );          if( rp.BitMap != NULL )      {        int h;        int v;	LONG bgpen = amiga_obtain_pen( bgcolour );	LONG fgpen = amiga_obtain_pen( fgcolour );        for( v = 0; v < cy; ++v )        {          UBYTE mask;                  mask = brush->pattern[ ( v + brush->yorigin ) & 7 ];          for( h = 0; h < cx; ++h )          {            if( mask & ( 1 << ( ( h + brush->xorigin ) & 7 ) ) )            {              SetAPen( &rp, fgpen );            }            else            {              SetAPen( &rp, bgpen );            }                WritePixel( &rp, h, v );          }        }	amiga_release_pen( bgpen );	amiga_release_pen( fgpen );		WorkingBltBitMapRastPort( rp.BitMap, 0, 0,				  amiga_window->RPort, x, y,				  cx, cy,				  opcode << 4 );      }      break;    }    default:      unimpl("brush %d\n", brush->style);  }}