int width = (x + xpos + slot->bitmap_left + bm->width >= 800) ? (799 - x - xpos - slot->bitmap_left) : bm->width;
for (xx = 0; xx < width; xx++) {
int width = (x + xpos + slot->bitmap_left + bm->width >= 800) ? (799 - x - xpos - slot->bitmap_left) : bm->width;
for (xx = 0; xx < width; xx++) {