From 4b635ae90e5cc65c8399de1355030b206d23a9fc Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Tue, 12 Jun 2018 20:36:32 +0300 Subject: [PATCH] Statusline d3d/software mode switch update. --- drawing.cpp | 7 +++++-- framebufferboards.cpp | 2 +- gfxboard.cpp | 2 +- include/statusline.h | 1 + mame/a2410.cpp | 2 +- od-win32/picasso96_win.cpp | 2 +- od-win32/statusline_win32.cpp | 7 +++++++ 7 files changed, 17 insertions(+), 6 deletions(-) diff --git a/drawing.cpp b/drawing.cpp index 329f1ba5..afae7f39 100644 --- a/drawing.cpp +++ b/drawing.cpp @@ -3674,7 +3674,7 @@ static void draw_frame2(struct vidbuffer *vbin, struct vidbuffer *vbout) static void draw_frame_extras(struct vidbuffer *vb, int y_start, int y_end) { - if (currprefs.leds_on_screen && ((currprefs.leds_on_screen & STATUSLINE_CHIPSET) && !(currprefs.leds_on_screen & STATUSLINE_TARGET))) { + if ((currprefs.leds_on_screen & STATUSLINE_CHIPSET) && softstatusline()) { int slx, sly; statusline_getpos(vb->monitor_id, &slx, &sly, vb->outwidth, vb->outheight, 1, 1); statusbar_y1 = sly + min_ypos_for_screen - 1; @@ -3992,8 +3992,11 @@ void redraw_frame(void) { last_drawn_line = 0; first_drawn_line = 32767; + // do not do full refresh if lagless mode + // because last line would appear as bright line + if (isvsync_chipset() < 0) + return; finish_drawing_frame(true); - //flush_screen (vidinfo->inbuffer, 0, 0); } void full_redraw_all(void) diff --git a/framebufferboards.cpp b/framebufferboards.cpp index 2c73de06..7a19064e 100644 --- a/framebufferboards.cpp +++ b/framebufferboards.cpp @@ -74,7 +74,7 @@ static bool fb_get_surface(struct fb_struct *data) gotsurf = true; } if (data->surface && gotsurf) { - if (!(currprefs.leds_on_screen & STATUSLINE_TARGET)) + if (softstatusline()) picasso_statusline(data->monitor_id, data->surface); } } diff --git a/gfxboard.cpp b/gfxboard.cpp index a0c0ee6c..acd64e8e 100644 --- a/gfxboard.cpp +++ b/gfxboard.cpp @@ -1026,7 +1026,7 @@ void gfxboard_vsync_handler(bool full_redraw_required, bool redraw_required) gb->gfxboard_surface = gfx_lock_picasso(gb->monitor_id, false, false); } if (gb->gfxboard_surface) { - if (!(currprefs.leds_on_screen & STATUSLINE_TARGET)) + if (softstatusline()) picasso_statusline(gb->monitor_id, gb->gfxboard_surface); } } diff --git a/include/statusline.h b/include/statusline.h index 089fd3f0..e290cd2f 100644 --- a/include/statusline.h +++ b/include/statusline.h @@ -30,6 +30,7 @@ static int td_pos = (TD_RIGHT | TD_BOTTOM); extern void draw_status_line_single(int monid, uae_u8 *buf, int bpp, int y, int totalwidth, uae_u32 *rc, uae_u32 *gc, uae_u32 *bc, uae_u32 *alpha); extern void statusline_single_erase(int monid, uae_u8 *buf, int bpp, int y, int totalwidth); extern void statusline_getpos(int monid, int *x, int *y, int width, int height, int hx, int vx); +extern bool softstatusline(void); #define STATUSTYPE_FLOPPY 1 #define STATUSTYPE_DISPLAY 2 diff --git a/mame/a2410.cpp b/mame/a2410.cpp index 4de7dcc6..71043868 100644 --- a/mame/a2410.cpp +++ b/mame/a2410.cpp @@ -680,7 +680,7 @@ static void get_a2410_surface(struct a2410_struct *data) gotsurf = true; } if (data->a2410_surface && gotsurf) { - if (!(currprefs.leds_on_screen & STATUSLINE_TARGET)) + if (softstatusline()) picasso_statusline(monid, data->a2410_surface); } } diff --git a/od-win32/picasso96_win.cpp b/od-win32/picasso96_win.cpp index d8f25183..53d08ee4 100644 --- a/od-win32/picasso96_win.cpp +++ b/od-win32/picasso96_win.cpp @@ -4647,7 +4647,7 @@ static void picasso_flushpixels(int index, uae_u8 *src, int off, bool render) dst = gfx_lock_picasso(monid, false, false); } if (dst) { - if (!(currprefs.leds_on_screen & STATUSLINE_TARGET)) { + if (softstatusline()) { picasso_statusline(monid, dst); } maxy = vidinfo->height; diff --git a/od-win32/statusline_win32.cpp b/od-win32/statusline_win32.cpp index a612edc1..bd5f7ebe 100644 --- a/od-win32/statusline_win32.cpp +++ b/od-win32/statusline_win32.cpp @@ -23,6 +23,13 @@ static HFONT statusline_font; static HPALETTE statusline_palette; static bool statusline_was_updated; +bool softstatusline(void) +{ + if (currprefs.gfx_api > 0) + return false; + return (currprefs.leds_on_screen & STATUSLINE_TARGET) == 0; +} + void deletestatusline(int monid) { if (monid) -- 2.47.3