From d2c739fb28cbc75cec89295913c5e114a8e35e90 Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Sat, 29 Aug 2020 20:01:45 +0300 Subject: [PATCH] NV(ram) status line string. --- include/statusline.h | 2 +- statusline.cpp | 42 +++++++++++++++++++++++------------------- 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/include/statusline.h b/include/statusline.h index 02589fc1..b8713e7e 100644 --- a/include/statusline.h +++ b/include/statusline.h @@ -19,7 +19,7 @@ static int td_pos = (TD_RIGHT | TD_BOTTOM); #define TD_TOTAL_HEIGHT (TD_PADY * 2 + TD_NUM_HEIGHT) -#define NUMBERS_NUM 19 +#define NUMBERS_NUM 20 #define TD_BORDER 0x333333 diff --git a/statusline.cpp b/statusline.cpp index 50363b63..bd924cd2 100644 --- a/statusline.cpp +++ b/statusline.cpp @@ -47,14 +47,15 @@ void statusline_getpos(int monid, int *x, int *y, int width, int height) } } -static const char *numbers = { /* ugly 0123456789CHD%+-PNK */ - "+++++++--++++-+++++++++++++++++-++++++++++++++++++++++++++++++++++++++++++++-++++++-++++----++---+--------------+++++++++++++++++++++" - "+xxxxx+--+xx+-+xxxxx++xxxxx++x+-+x++xxxxx++xxxxx++xxxxx++xxxxx++xxxxx++xxxx+-+x++x+-+xxx++-+xx+-+x---+----------+xxxxx++x+++x++x++x++" - "+x+++x+--++x+-+++++x++++++x++x+++x++x++++++x++++++++++x++x+++x++x+++x++x++++-+x++x+-+x++x+--+x++x+--+x+----+++--+x---x++xx++x++x+x+++" - "+x+-+x+---+x+-+xxxxx++xxxxx++xxxxx++xxxxx++xxxxx+--++x+-+xxxxx++xxxxx++x+----+xxxx+-+x++x+----+x+--+xxx+--+xxx+-+xxxxx++x+x+x++xx++++" - "+x+++x+---+x+-+x++++++++++x++++++x++++++x++x+++x+--+x+--+x+++x++++++x++x++++-+x++x+-+x++x+---+x+x+--+x+----+++--+x++++++x+x+x++x+x+++" - "+xxxxx+---+x+-+xxxxx++xxxxx+----+x++xxxxx++xxxxx+--+x+--+xxxxx++xxxxx++xxxx+-+x++x+-+xxx+---+x++xx--------------+x+----+x++xx++x++x++" - "+++++++---+++-++++++++++++++----+++++++++++++++++--+++--++++++++++++++++++++-++++++-++++------------------------+++----++++++++++++++" +static const char *numbers = { /* ugly 0123456789CHD%+-PNKV */ + "+++++++--++++-+++++++++++++++++-++++++++++++++++++++++++++++++++++++++++++++-++++++-++++----++---+--------------++++++++++-++++++++++++ +++" + "+xxxxx+--+xx+-+xxxxx++xxxxx++x+-+x++xxxxx++xxxxx++xxxxx++xxxxx++xxxxx++xxxx+-+x++x+-+xxx++-+xx+-+x---+----------+xxxxx++x+-+x++x++x++x+ +x+" + "+x+++x+--++x+-+++++x++++++x++x+++x++x++++++x++++++++++x++x+++x++x+++x++x++++-+x++x+-+x++x+--+x++x+--+x+----+++--+x---x++xx++x++x+x+++x+ +x+" + "+x+-+x+---+x+-+xxxxx++xxxxx++xxxxx++xxxxx++xxxxx+--++x+-+xxxxx++xxxxx++x+----+xxxx+-+x++x+----+x+--+xxx+--+xxx+-+xxxxx++x+x+x++xx+ +x++x+ " + "+x+++x+---+x+-+x++++++++++x++++++x++++++x++x+++x+--+x+--+x+++x++++++x++x++++-+x++x+-+x++x+---+x+x+--+x+----+++--+x++++++x+x+x++x+x++ +xx+ " + "+xxxxx+---+x+-+xxxxx++xxxxx+----+x++xxxxx++xxxxx+--+x+--+xxxxx++xxxxx++xxxx+-+x++x+-+xxx+---+x++xx--------------+x+----+x++xx++x++x+ +xx+ " + "+++++++---+++-++++++++++++++----+++++++++++++++++--+++--++++++++++++++++++++-++++++-++++------------------------+++----+++++++++++++ ++++ " +// x x x x x x x x x x x x x x x x x x x x x }; STATIC_INLINE uae_u32 ledcolor(uae_u32 c, uae_u32 *rc, uae_u32 *gc, uae_u32 *bc, uae_u32 *a) @@ -142,7 +143,7 @@ void draw_status_line_single(int monid, uae_u8 *buf, int bpp, int y, int totalwi x_start = TD_PADX * mult; for (led = 0; led < LED_MAX; led++) { - int side, pos, num1 = -1, num2 = -1, num3 = -1, num4 = -1; + int 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, extraborder = 0; @@ -176,7 +177,6 @@ void draw_status_line_single(int monid, uae_u8 *buf, int bpp, int y, int totalwi extraborder = 1; } } - side = gui_data.drive_side; on_rgb &= 0xffffff; off_rgb = rgbmuldiv(on_rgb, 2, 4); on_rgb2 = rgbmuldiv(on_rgb, 2, 3); @@ -287,17 +287,21 @@ void draw_status_line_single(int monid, uae_u8 *buf, int bpp, int y, int totalwi on_rgb = 0x0000cc; // "normal" overflow off_rgb = 0x000000; am = 3; - } else if (led == LED_MD && gui_data.drives[3].drive_disabled) { + } else if (led == LED_MD) { // DF3 reused as internal non-volatile ram led (cd32/cdtv) - pos = 7 + 3; - if (gui_data.md >= 0) { - on = gui_data.md; - on_rgb = on == 2 ? 0xcc0000 : 0x00cc00; - off_rgb = 0x003300; + if (gui_data.drives[3].drive_disabled && gui_data.md >= 0) { + pos = 7 + 3; + if (gui_data.md >= 0) { + on = gui_data.md; + on_rgb = on == 2 ? 0xcc0000 : 0x00cc00; + off_rgb = 0x003300; + } + num1 = -1; + num2 = 17; + num3 = 19; + } else { + continue; } - num1 = -1; - num2 = -1; - num3 = -1; } else if (led == LED_NET) { pos = 6; if (gui_data.net >= 0) { -- 2.47.3