Try this: BGPUT layer,x,y,tile or 1<<14. The above line means that the bit 14 will be set to 1. With that change the tile will be flipped.