v /= div;
out |= v << (i * 8);
}
+ out |= rgb & 0xff000000;
return out;
}
int side, pos, num1 = -1, num2 = -1, num3 = -1, num4 = -1;
int x, c, on = 0, am = 2;
xcolnr on_rgb = 0, on_rgb2 = 0, off_rgb = 0, pen_rgb = 0;
- int half = 0;
+ int half = 0, extraborder = 0;
+
cb = ledcolor(TD_BORDER, rc, gc, bc, alpha);
if (!(currprefs.leds_on_screen_mask[ad->picasso_on ? 1 : 0] & (1 << led)))
if (gid->df[0] == 0) {
pen_rgb = ledcolor(0x00aaaaaa, rc, gc, bc, alpha);
} else if (gid->floppy_protected) {
- cb = ledcolor(0xff8040, rc, gc, bc, alpha);
+ cb = ledcolor(0x00cc00, rc, gc, bc, alpha);
+ extraborder = 1;
}
}
side = gui_data.drive_side;
on_rgb |= 0x33000000;
off_rgb |= 0x33000000;
if (half > 0) {
- c = ledcolor (on ? (y >= TD_TOTAL_HEIGHT / 2 ? on_rgb2 : on_rgb) : off_rgb, rc, gc, bc, alpha);
+ int halfon = y >= TD_TOTAL_HEIGHT / 2;
+ c = ledcolor(on ? (halfon ? on_rgb2 : on_rgb) : off_rgb, rc, gc, bc, alpha);
+ if (!halfon && on && extraborder)
+ cb = rgbmuldiv(cb, 2, 3);
} else if (half < 0) {
- c = ledcolor (on ? (y < TD_TOTAL_HEIGHT / 2 ? on_rgb2 : on_rgb) : off_rgb, rc, gc, bc, alpha);
+ int halfon = y < TD_TOTAL_HEIGHT / 2;
+ c = ledcolor(on ? (halfon ? on_rgb2 : on_rgb) : off_rgb, rc, gc, bc, alpha);
+ if (!halfon && on && extraborder)
+ cb = rgbmuldiv(cb, 2, 3);
} else {
- c = ledcolor (on ? on_rgb : off_rgb, rc, gc, bc, alpha);
+ c = ledcolor(on ? on_rgb : off_rgb, rc, gc, bc, alpha);
}
+
border = 0;
if (y == 0 || y == TD_TOTAL_HEIGHT - 1) {
c = cb;
}
x = x_start + pos * TD_WIDTH;
- if (!border)
- putpixel (buf, NULL, bpp, x - 1, cb, 0);
- for (j = 0; j < TD_LED_WIDTH; j++)
- putpixel (buf, NULL, bpp, x + j, c, 0);
- if (!border)
- putpixel (buf, NULL, bpp, x + j, cb, 0);
+ if (!border) {
+ putpixel(buf, NULL, bpp, x - 1, cb, 0);
+ }
+ for (j = 0; j < TD_LED_WIDTH; j++) {
+ putpixel(buf, NULL, bpp, x + j, c, 0);
+ }
+ if (!border) {
+ putpixel(buf, NULL, bpp, x + j, cb, 0);
+ }
if (y >= TD_PADY && y - TD_PADY < TD_NUM_HEIGHT) {
if (num3 >= 0) {