Skip to content

Commit

Permalink
DFx OSD write protected border.
Browse files Browse the repository at this point in the history
  • Loading branch information
tonioni committed Mar 7, 2020
1 parent 24a1c7c commit 62d936a
Showing 1 changed file with 24 additions and 11 deletions.
35 changes: 24 additions & 11 deletions statusline.cpp
Expand Up @@ -88,6 +88,7 @@ static uae_u32 rgbmuldiv(uae_u32 rgb, int mul, int div)
v /= div;
out |= v << (i * 8);
}
out |= rgb & 0xff000000;
return out;
}

Expand All @@ -109,7 +110,8 @@ void draw_status_line_single(int monid, uae_u8 *buf, int bpp, int y, int totalwi
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)))
Expand All @@ -135,7 +137,8 @@ void draw_status_line_single(int monid, uae_u8 *buf, int bpp, int y, int totalwi
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;
Expand Down Expand Up @@ -281,25 +284,35 @@ void draw_status_line_single(int monid, uae_u8 *buf, int bpp, int y, int totalwi
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;
border = 1;
}

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) {
Expand Down

0 comments on commit 62d936a

Please sign in to comment.