public OamEntry toOamEntry() {
      return new OamEntry(new byte[] {
          (byte) sprite.y,
          (byte) sprite.x,
          (byte)(sprite.upperTile.usages.getValueAt(from) % 0x180),
          (byte) (sprite.palette.usages.getValueAt(from)
              | ((sprite.upperTile.usages.getValueAt(from) >= 0x180 ? 1 : 0) << 3)
              | ((sprite.flipHorizontally ? 1 : 0) << 5)
              | ((sprite.flipVertically ? 1 : 0) << 6)
              | ((sprite.objToBgPriority ? 1 : 0) << 7))
      });
    }