bsnes-plus icon indicating copy to clipboard operation
bsnes-plus copied to clipboard

macos: emulated screen is only 1/4 of the viewport window

Open JamesDunne opened this issue 3 years ago • 6 comments

image

Built using my instructions i commented at the end of issue #214 against Qt 5.15.2 installed via HomeBrew qt@5.

Using MacBook 15-inch 2018 model with Mojave 10.14.6. Display is builtin retina screen.

JamesDunne avatar Jul 02 '21 15:07 JamesDunne

The screenshot/issue above is with the Qt-OpenGL video driver. The Qt-Raster driver looks normal.

image

JamesDunne avatar Jul 02 '21 16:07 JamesDunne

I'll see if I can repro/investigate this on my MacBook. Thanks for confirming that the Qt-Raster backend still works okay, at least.

Maybe I'm wrong, but I swear this used to work fine in the past - might just be down to something that changed in a Qt update w/r/t retina displays or something.

devinacker avatar Jul 04 '21 18:07 devinacker

No problem. Also, I spoke too soon on the Qt-Raster driver. That one creates a weird ghost image after a while which is hard to explain. I can't resolve it until I quit and restart.

JamesDunne avatar Jul 04 '21 21:07 JamesDunne

image

This is what I see for Qt-Raster. Lots of previous frames ghosting into the current one and it looks like it's over-exposed.

JamesDunne avatar Jul 15 '21 21:07 JamesDunne

I recall encountering both of these problems on my end, though I use OpenGL, and actually don't play a lot of games through bsnes-plus yet (it's more of a substitute while I'm on standby for SNES9X to catch up on the Mac port). The quarter-screen case has a couple of known fixes, but they either involve a flag in an app bundle config file or some Cocoa-side programming. This emulator has no Cocoa-side files.

KungFuFurby avatar Jul 16 '21 23:07 KungFuFurby

This patch resolves the issue for me:

diff --git a/bsnes/ruby/video/qtopengl.cpp b/bsnes/ruby/video/qtopengl.cpp
index c357c40..c484163 100644
--- a/bsnes/ruby/video/qtopengl.cpp
+++ b/bsnes/ruby/video/qtopengl.cpp
@@ -52,6 +52,8 @@ public:
     void paintGL() {
       unsigned outputWidth  = width();
       unsigned outputHeight = height();
+      outputWidth *= QApplication::desktop()->devicePixelRatio();
+      outputHeight *= QApplication::desktop()->devicePixelRatio();

       glMatrixMode(GL_PROJECTION);
       glLoadIdentity();

JamesDunne avatar Jul 20 '21 13:07 JamesDunne