refactoring.
Use ~255 and & 255 , ~511 and & 511 are really important because
you can, in example,  overflow the x, y position field.