From bfe11a46b21f0204e7347d90102c811b641edfaa Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Sat, 6 Nov 2021 19:48:30 +0200 Subject: [PATCH] Support for old vertical size screenshots (without chipset-dependant possible extra line) --- drawing.cpp | 10 ++++++++-- include/drawing.h | 2 +- od-win32/rp.cpp | 2 +- od-win32/win32_scaler.cpp | 2 +- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/drawing.cpp b/drawing.cpp index 706de627..2bb46c08 100644 --- a/drawing.cpp +++ b/drawing.cpp @@ -546,14 +546,20 @@ static void set_vblanking_limits(void) } } -int get_vertical_visible_height(void) +int get_vertical_visible_height(bool useoldsize) { struct vidbuf_description *vidinfo = &adisplays[0].gfxvidinfo; int h = vidinfo->drawbuffer.inheight; int vbstrt, vbstop; if (programmedmode <= 1) { - h = (maxvpos_display + maxvpos_display_vsync - minfirstline) << currprefs.gfx_vresolution; + h = maxvpos_display + maxvpos_display_vsync - minfirstline; + if (useoldsize) { + if (h == 288 || h == 243) { + h--; + } + } + h <<= currprefs.gfx_vresolution; } if (interlace_seen && currprefs.gfx_vresolution > 0) { h -= 1 << (currprefs.gfx_vresolution - 1); diff --git a/include/drawing.h b/include/drawing.h index b6cb91ac..ed96815f 100644 --- a/include/drawing.h +++ b/include/drawing.h @@ -375,7 +375,7 @@ extern void putpixel (uae_u8 *buf, uae_u8 *genlockbuf, int bpp, int x, xcolnr c8 extern void allocvidbuffer(int monid, struct vidbuffer *buf, int width, int height, int depth); extern void freevidbuffer(int monid, struct vidbuffer *buf); extern void check_prefs_picasso(void); -extern int get_vertical_visible_height(void); +extern int get_vertical_visible_height(bool); /* Finally, stuff that shouldn't really be shared. */ diff --git a/od-win32/rp.cpp b/od-win32/rp.cpp index dcd9d73d..1dd20a02 100644 --- a/od-win32/rp.cpp +++ b/od-win32/rp.cpp @@ -1307,7 +1307,7 @@ static int screencap(LPCVOID pData, struct AmigaMonitor *mon) struct vidbuf_description *avidinfo = &adisplays[0].gfxvidinfo; struct vidbuffer vb; int w = avidinfo->drawbuffer.inwidth; - int h = get_vertical_visible_height(); + int h = get_vertical_visible_height(true); allocvidbuffer(0, &vb, w, h, avidinfo->drawbuffer.pixbytes * 8); set_custom_limits(0, 0, 0, 0); draw_frame(&vb); diff --git a/od-win32/win32_scaler.cpp b/od-win32/win32_scaler.cpp index 0f3aa35f..fe466afe 100644 --- a/od-win32/win32_scaler.cpp +++ b/od-win32/win32_scaler.cpp @@ -804,7 +804,7 @@ uae_u8 *getfilterbuffer(int monid, int *widthp, int *heightp, int *pitch, int *d h = vb->outheight; if (!monid) { // if native screen: do not include vertical blank - h = get_vertical_visible_height(); + h = get_vertical_visible_height(false); } if (pitch) *pitch = vb->rowbytes; -- 2.47.3