]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
statusbar internal changes.
authorToni Wilen <twilen@winuae.net>
Sat, 25 Feb 2017 15:59:33 +0000 (17:59 +0200)
committerToni Wilen <twilen@winuae.net>
Sat, 25 Feb 2017 15:59:33 +0000 (17:59 +0200)
drawing.cpp
include/statusline.h
od-win32/direct3d.cpp
od-win32/picasso96_win.cpp
od-win32/win32_scaler.cpp
statusline.cpp

index 9d24806711379c070fc8816b6554b480cce0ab10..bb504cb342a5c0f24b7df2f27d07e86b309d8d3f 100644 (file)
@@ -2772,7 +2772,7 @@ static void do_color_changes (line_draw_func worker_border, line_draw_func worke
                if (i == dip_for_drawing->last_color_change)
                        nextpos = endpos;
                else
-                       nextpos = coord_hw_to_window_x (curr_color_changes[i].linepos);
+                       nextpos = shres_coord_hw_to_window_x (curr_color_changes[i].linepos);
 
                nextpos_in_range = nextpos;
                if (nextpos > endpos)
@@ -3747,7 +3747,7 @@ static void finish_drawing_frame (void)
 
        if (currprefs.leds_on_screen && ((currprefs.leds_on_screen & STATUSLINE_CHIPSET) && !(currprefs.leds_on_screen & STATUSLINE_TARGET))) {
                int slx, sly;
-               statusline_getpos(&slx, &sly, vb->outwidth, vb->outheight);
+               statusline_getpos(&slx, &sly, vb->outwidth, vb->outheight, 1, 1);
                statusbar_y1 = sly + min_ypos_for_screen - 1;
                statusbar_y2 = statusbar_y1 + TD_TOTAL_HEIGHT + 1;
                draw_status_line(sly, -1);
index 1a03604d21d6b2742a0cdd3cb8503875d927f9b8..cebe4b74bed7cd600c69b190aed4bd4244f22b6f 100644 (file)
@@ -29,7 +29,7 @@ static int td_pos = (TD_RIGHT | TD_BOTTOM);
 
 extern void draw_status_line_single (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(uae_u8 *buf, int bpp, int y, int totalwidth);
-extern void statusline_getpos(int *x, int *y, int width, int height);
+extern void statusline_getpos(int *x, int *y, int width, int height, int hx, int vx);
 
 #define STATUSTYPE_FLOPPY 1
 #define STATUSTYPE_DISPLAY 2
index 2ad8953dd9be4e97678604a4928c342d55a45f63..cf3e05a17c3c9786166b98853656ef8ec3e5ebdb 100644 (file)
@@ -156,6 +156,7 @@ static int vsync2, guimode, maxscanline, variablerefresh;
 static int resetcount;
 static double cursor_x, cursor_y;
 static bool cursor_v, cursor_scale;
+static int statusbar_vx = 1, statusbar_hx = 1;
 
 #define NUMVERTICES 8
 #define D3DFVF_TLVERTEX D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1
@@ -1315,10 +1316,9 @@ static void updateleds (void)
        HRESULT hr;
        static uae_u32 rc[256], gc[256], bc[256], a[256];
        static int done;
-       int i, y;
 
        if (!done) {
-               for (i = 0; i < 256; i++) {
+               for (int i = 0; i < 256; i++) {
                        rc[i] = i << 16;
                        gc[i] = i << 8;
                        bc[i] = i << 0;
@@ -1331,15 +1331,21 @@ static void updateleds (void)
                write_log (_T("%d: SL LockRect failed: %s\n"), D3DHEAD, D3D_ErrorString (hr));
                return;
        }
-       for (y = 0; y < TD_TOTAL_HEIGHT; y++) {
+
+       for (int y = 0; y < TD_TOTAL_HEIGHT * statusbar_vx; y++) {
                uae_u8 *buf = (uae_u8*)locked.pBits + y * locked.Pitch;
-               statusline_single_erase(buf, 32 / 8, y, ledwidth);
+               statusline_single_erase(buf, 32 / 8, y, ledwidth * statusbar_hx);
        }
        statusline_render((uae_u8*)locked.pBits, 32 / 8, locked.Pitch, ledwidth, ledheight, rc, gc, bc, a);
-       for (y = 0; y < TD_TOTAL_HEIGHT; y++) {
-               uae_u8 *buf = (uae_u8*)locked.pBits + y * locked.Pitch;
+
+       int y = 0;
+       for (int yy = 0; yy < statusbar_vx * TD_TOTAL_HEIGHT; yy++) {
+               uae_u8 *buf = (uae_u8*)locked.pBits + yy * locked.Pitch;
                draw_status_line_single (buf, 32 / 8, y, ledwidth, rc, gc, bc, a);
+               if ((yy % statusbar_vx) == 0)
+                       y++;
        }
+
        ledtexture->UnlockRect (0);
 }
 
@@ -1347,7 +1353,7 @@ static int createledtexture (void)
 {
        ledwidth = window_w;
        ledheight = TD_TOTAL_HEIGHT;
-       ledtexture = createtext (ledwidth, ledheight, D3DFMT_A8R8G8B8);
+       ledtexture = createtext (ledwidth * statusbar_hx, ledheight * statusbar_vx, D3DFMT_A8R8G8B8);
        if (!ledtexture)
                return 0;
        return 1;
@@ -3240,7 +3246,7 @@ static void D3D_render2 (void)
                }
                if (ledtexture && (((currprefs.leds_on_screen & STATUSLINE_RTG) && WIN32GFX_IsPicassoScreen ()) || ((currprefs.leds_on_screen & STATUSLINE_CHIPSET) && !WIN32GFX_IsPicassoScreen ()))) {
                        int slx, sly;
-                       statusline_getpos (&slx, &sly, window_w, window_h);
+                       statusline_getpos (&slx, &sly, window_w, window_h, statusbar_hx, statusbar_vx);
                        v.x = slx;
                        v.y = sly;
                        v.z = 0;
index a9e70cff8084130a311a3c11bee7c4d669a3fbc6..a8607bb85d3d0d9c908c40525db551e468e469f7 100644 (file)
@@ -3985,7 +3985,7 @@ void picasso_statusline (uae_u8 *dst)
        if (dst_width > picasso_vidinfo.width)
                dst_width = picasso_vidinfo.width;
        pitch = picasso_vidinfo.rowbytes;
-       statusline_getpos (&slx, &sly, picasso96_state.Width, dst_height);
+       statusline_getpos (&slx, &sly, picasso96_state.Width, dst_height, 1, 1);
        if (currprefs.gfx_api)
                statusline_render(dst + sly * pitch, picasso_vidinfo.pixbytes, pitch, dst_width, dst_height, p96rc, p96gc, p96bc, NULL);
        yy = 0;
index 6ab6956a68e01598d6d84bdeb8eb64c9eb2d5084..cfdd58bed81e8f7104954c976cefe85a547e49a5 100644 (file)
@@ -721,7 +721,7 @@ static void statusline (void)
 
        if (!(currprefs.leds_on_screen & STATUSLINE_CHIPSET) || !tempsurf)
                return;
-       statusline_getpos (&slx, &sly, dst_width, dst_height);
+       statusline_getpos (&slx, &sly, dst_width, dst_height, 1, 1);
        lx = dst_width;
        ly = dst_height;
        SetRect (&sr, slx, 0, slx + lx, TD_TOTAL_HEIGHT);
index bfa6f86eef377534d1f962b0aa6256bbcbc5e9c5..aae1f6dda168cec94a00302b05214c92efb0a726 100644 (file)
@@ -19,8 +19,9 @@
 * Some code to put status information on the screen.
 */
 
-void statusline_getpos (int *x, int *y, int width, int height)
+void statusline_getpos (int *x, int *y, int width, int height, int hx, int vx)
 {
+       int total_height = TD_TOTAL_HEIGHT * vx;
        if (currprefs.osd_pos.x >= 20000) {
                if (currprefs.osd_pos.x >= 30000)
                        *y = width * (currprefs.osd_pos.x - 30000) / 1000;
@@ -34,12 +35,12 @@ void statusline_getpos (int *x, int *y, int width, int height)
        }
        if (currprefs.osd_pos.y >= 20000) {
                if (currprefs.osd_pos.y >= 30000)
-                       *y = (height - TD_TOTAL_HEIGHT) * (currprefs.osd_pos.y - 30000) / 1000;
+                       *y = (height - total_height) * (currprefs.osd_pos.y - 30000) / 1000;
                else
-                       *y = (height - TD_TOTAL_HEIGHT) - ((height - TD_TOTAL_HEIGHT) * (30000 - currprefs.osd_pos.y) / 1000);
+                       *y = (height - total_height) - ((height - total_height) * (30000 - currprefs.osd_pos.y) / 1000);
        } else {
                if (currprefs.osd_pos.y >= 0)
-                       *y = height - TD_TOTAL_HEIGHT - currprefs.osd_pos.y;
+                       *y = height - total_height - currprefs.osd_pos.y;
                else
                        *y = -currprefs.osd_pos.y + 1;
        }