ODBETA: use 320x240 sdl surface when not hw scaling on 320x480 LCDs
authorsydarn <sydarn@proton.me>
Tue, 21 Nov 2023 21:00:40 +0000 (22:00 +0100)
committeririxxxx <31696370+irixxxx@users.noreply.github.com>
Sun, 3 Dec 2023 20:35:51 +0000 (21:35 +0100)
configure
platform/common/plat_sdl.c

index aede721..3c88c6a 100755 (executable)
--- a/configure
+++ b/configure
@@ -127,6 +127,7 @@ set_platform()
   odbeta)
     # various devices with opendingux beta, arch flags from toolchain default
     MFLAGS=""
+    CFLAGS="$CFLAGS -D__ODBETA__"
     platform="opendingux"
     ;;
   pandora)
index b6b4261..219b2c3 100644 (file)
@@ -331,9 +331,20 @@ static void plat_sdl_resize(int w, int h)
 {
        // take over new settings
        if (plat_sdl_screen->w != area.w || plat_sdl_screen->h != area.h) {
-               g_menuscreen_h = plat_sdl_screen->h;
-               g_menuscreen_w = plat_sdl_screen->w;
-               resize_buffers();
+#if defined(__ODBETA__)
+        if (currentConfig.vscaling != EOPT_SCALE_HW &&
+                plat_sdl_screen->w == 320 &&
+                plat_sdl_screen->h == 480) {
+                   g_menuscreen_h = 240;
+                   g_menuscreen_w = 320;
+
+        } else
+#endif
+        {
+                   g_menuscreen_h = plat_sdl_screen->h;
+                   g_menuscreen_w = plat_sdl_screen->w;
+        }
+        resize_buffers();
                rendstatus_old = -1;
        }
 }