summaryrefslogtreecommitdiff
path: root/emulators
diff options
context:
space:
mode:
authortsutsui <tsutsui@pkgsrc.org>2020-08-13 06:33:59 +0000
committertsutsui <tsutsui@pkgsrc.org>2020-08-13 06:33:59 +0000
commita2f05b2f276d225422a14ef9be33ad1605dfced8 (patch)
tree3fa7ad73811b0ac5d71cf5a60ae58a352a7a76f7 /emulators
parent569db03449fde67a1410099924ecd809b27569cb (diff)
downloadpkgsrc-a2f05b2f276d225422a14ef9be33ad1605dfced8.tar.gz
tme: avoid double-scaled screen on multi HD display environment.
It looks the original implementation assumed a single 4:3 display. Bump PKGREVISION.
Diffstat (limited to 'emulators')
-rw-r--r--emulators/tme/Makefile4
-rw-r--r--emulators/tme/distinfo3
-rw-r--r--emulators/tme/patches/patch-host_gtk_gtk-screen.c55
3 files changed, 59 insertions, 3 deletions
diff --git a/emulators/tme/Makefile b/emulators/tme/Makefile
index c5e9dc0be3e..4c8f05b495a 100644
--- a/emulators/tme/Makefile
+++ b/emulators/tme/Makefile
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.78 2020/08/13 05:59:51 tsutsui Exp $
+# $NetBSD: Makefile,v 1.79 2020/08/13 06:33:59 tsutsui Exp $
#
DISTNAME= tme-0.8
-PKGREVISION= 44
+PKGREVISION= 45
CATEGORIES= emulators
MASTER_SITES= http://csail.mit.edu/~fredette/tme/
diff --git a/emulators/tme/distinfo b/emulators/tme/distinfo
index 3395e0e694b..d7417640997 100644
--- a/emulators/tme/distinfo
+++ b/emulators/tme/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.27 2020/08/13 05:59:51 tsutsui Exp $
+$NetBSD: distinfo,v 1.28 2020/08/13 06:33:59 tsutsui Exp $
SHA1 (tme-0.8.tar.gz) = dd4f3421c20ceed548c5328a21dbb26e80f46b9c
RMD160 (tme-0.8.tar.gz) = 6bd505c5fa7810d37f436883383c4ba655df2ded
@@ -9,6 +9,7 @@ SHA1 (patch-configure.in) = 9795ad35a16698057f01e78314b5ee215065e450
SHA1 (patch-host_bsd_Makefile.am) = db0add22732e95b18886877a92e57e1a19d3099f
SHA1 (patch-host_bsd_Makefile.in) = 0c361aca770ec7e323cef150e0e1b29d6a442306
SHA1 (patch-host_bsd_bsd-if.c) = 929ddb1cbf3cbbc84dc9b1c8facba42032857dfa
+SHA1 (patch-host_gtk_gtk-screen.c) = 2f4da0467e6028066c70552dceef6df42c42f2c2
SHA1 (patch-host_posix_posix-serial.c) = b1e009d6432c49672ca07a16ced939c8a46ef6e2
SHA1 (patch-ic_ieee754_ieee754-misc-auto.sh) = afeb7452ef64bcae71e4dbae21881cff12cb9d4f
SHA1 (patch-ic_m68k_m6888x.c) = fe42dce7bf5abc69e2c9e15967d5e862ef651a0e
diff --git a/emulators/tme/patches/patch-host_gtk_gtk-screen.c b/emulators/tme/patches/patch-host_gtk_gtk-screen.c
new file mode 100644
index 00000000000..f8ee3f6e843
--- /dev/null
+++ b/emulators/tme/patches/patch-host_gtk_gtk-screen.c
@@ -0,0 +1,55 @@
+$NetBSD: patch-host_gtk_gtk-screen.c,v 1.1 2020/08/13 06:33:59 tsutsui Exp $
+
+- Check also screen width and height to choose default screen size
+ for modern HD and multi display environments
+
+--- host/gtk/gtk-screen.c.orig 2009-08-30 21:39:03.000000000 +0000
++++ host/gtk/gtk-screen.c
+@@ -171,6 +171,8 @@ _tme_gtk_screen_mode_change(struct tme_f
+ const struct tme_fb_xlat *fb_xlat_a;
+ int scale;
+ unsigned long fb_area, avail_area, percentage;
++ unsigned long fb_width, fb_height, screen_width, screen_height;
++ unsigned long hpercentage, wpercentage;
+ gint width, height;
+ gint height_extra;
+ const void *map_g_old;
+@@ -207,23 +209,32 @@ _tme_gtk_screen_mode_change(struct tme_f
+ scale = screen->tme_gtk_screen_fb_scale;
+ if (scale < 0) {
+
++ fb_width = conn_fb_other->tme_fb_connection_width;
++ fb_height = conn_fb_other->tme_fb_connection_height;
++ screen_width = gdk_screen_width();
++ screen_height = gdk_screen_height();
++
+ /* calulate the areas, in square pixels, of the emulated
+ framebuffer and the host's screen: */
+- fb_area = (conn_fb_other->tme_fb_connection_width
+- * conn_fb_other->tme_fb_connection_height);
+- avail_area = (gdk_screen_width()
+- * gdk_screen_height());
++ fb_area = fb_width * fb_height;
++ avail_area = screen_width * screen_height;
+
+ /* see what percentage of the host's screen would be taken up by
+ an unscaled emulated framebuffer: */
+ percentage = (fb_area * 100) / avail_area;
+
++ /* also check percentage of the actual host's screen width and height
++ for modern HD or multi displays */
++ wpercentage = (fb_width * 100) / screen_width;
++ hpercentage = (fb_height * 100) / screen_height;
++
+ /* if this is at least 70%, halve the emulated framebuffer, else
+ if this is 30% or less, double the emulated framebuffer: */
+- if (percentage >= 70) {
++ /* also check screen width and height fit the emulated framebuffer */
++ if (percentage >= 70 || wpercentage > 100 || hpercentage > 100) {
+ scale = TME_FB_XLAT_SCALE_HALF;
+ }
+- else if (percentage <= 30) {
++ else if (percentage <= 30 && wpercentage <= 50 && hpercentage <= 50) {
+ scale = TME_FB_XLAT_SCALE_DOUBLE;
+ }
+ else {